From 4d714280d2f8d0b13de4c532a940cb85b48b5db5 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 7 Aug 2014 09:20:19 -0400 Subject: Allow binary files to be served. * guix-web (serve-static-asset): Read file as bytevector instead of string. --- guix-web | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix-web b/guix-web index 4afc56a..1dcf5a3 100755 --- a/guix-web +++ b/guix-web @@ -20,6 +20,7 @@ (use-modules (ice-9 rdelim) (ice-9 match) + (ice-9 binary-ports) (srfi srfi-1) (srfi srfi-26) ((system repl server) @@ -59,8 +60,7 @@ (not (directory? filename)) (list `((content-type . ,(assoc-ref file-mime-types (file-extension filename)))) - (with-input-from-file filename - read-string))))) + (call-with-input-file filename get-bytevector-all))))) (define (render-html sxml) (list '((content-type . (text/html))) -- cgit v1.2.3