summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-08-07 07:13:10 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-08-07 07:13:10 -0400
commitee6448467162ba7f399f5e0adfc3412e3e00c1a7 (patch)
tree572c03784cae24009f8b8ac3581eb072035025dd
parent58d759eb8b1632ded5e05b82215b794ad45966b8 (diff)
Render HTML directly to client port rather than to string.
* guix-web (render-html): Render to port.
-rwxr-xr-xguix-web8
1 files changed, 3 insertions, 5 deletions
diff --git a/guix-web b/guix-web
index 6031122..0b322e9 100755
--- a/guix-web
+++ b/guix-web
@@ -64,11 +64,9 @@
(define (render-html sxml)
(list '((content-type . (text/html)))
- (string-append
- "<!DOCTYPE html>\n"
- (with-output-to-string
- (lambda ()
- (sxml->xml sxml))))))
+ (lambda (port)
+ (display "<!DOCTYPE html>" port)
+ (sxml->xml sxml port))))
(define (render-json json)
(list '((content-type . (application/json)))