summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-08-07 09:20:19 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-08-07 09:23:57 -0400
commit4d714280d2f8d0b13de4c532a940cb85b48b5db5 (patch)
treeb4f4cb8e8077f62f7d02c3b01a227245daeaa897
parent6e7eaefb0df94cd492eb5dcc2f6daf2219d7552a (diff)
Allow binary files to be served.
* guix-web (serve-static-asset): Read file as bytevector instead of string.
-rwxr-xr-xguix-web4
1 files 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)))