diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-08-07 09:20:19 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-08-07 09:23:57 -0400 |
commit | 4d714280d2f8d0b13de4c532a940cb85b48b5db5 (patch) | |
tree | b4f4cb8e8077f62f7d02c3b01a227245daeaa897 | |
parent | 6e7eaefb0df94cd492eb5dcc2f6daf2219d7552a (diff) |
Allow binary files to be served.
* guix-web (serve-static-asset): Read file as bytevector instead of string.
-rwxr-xr-x | guix-web | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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))) |