summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-05-19 22:23:22 +0100
committerChristopher Baines <mail@cbaines.net>2019-05-19 22:23:22 +0100
commit2c3533107528c9f58813f7f5c171e909ab7d2223 (patch)
tree935a87857e26fa6bf1636c67f0957923adb0a7a2
parente92e095ee9bab35901f768c5712383649c588e70 (diff)
downloaddata-service-2c3533107528c9f58813f7f5c171e909ab7d2223.tar
data-service-2c3533107528c9f58813f7f5c171e909ab7d2223.tar.gz
Add #:code option to render-html
-rw-r--r--guix-data-service/web/render.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix-data-service/web/render.scm b/guix-data-service/web/render.scm
index 248de3c..5121782 100644
--- a/guix-data-service/web/render.scm
+++ b/guix-data-service/web/render.scm
@@ -91,9 +91,12 @@
failure))
failure)))
-(define* (render-html #:key sxml (extra-headers '()))
- (list (append extra-headers
- '((content-type . (text/html))))
+(define* (render-html #:key sxml (extra-headers '())
+ (code 200))
+ (list (build-response
+ #:code code
+ #:headers (append extra-headers
+ '((content-type . (text/html)))))
(lambda (port)
(sxml->html sxml port))))