diff options
author | Christopher Baines <mail@cbaines.net> | 2019-05-18 20:25:05 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-05-18 20:25:05 +0100 |
commit | 0ca5748c0ff082500fa27cd8032f14ccbc4e6df4 (patch) | |
tree | 63a7d613b85bb926aa85a6cfc6308fa9af96a36b | |
parent | 03faff5da040f6d5626dff0cfdcfd20d9f35f7ef (diff) | |
download | data-service-0ca5748c0ff082500fa27cd8032f14ccbc4e6df4.tar data-service-0ca5748c0ff082500fa27cd8032f14ccbc4e6df4.tar.gz |
Enable passing extra headers for JSON responses
Mostly to enable passing the cache-control header.
-rw-r--r-- | guix-data-service/web/render.scm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/guix-data-service/web/render.scm b/guix-data-service/web/render.scm index 94cbf55..248de3c 100644 --- a/guix-data-service/web/render.scm +++ b/guix-data-service/web/render.scm @@ -97,8 +97,9 @@ (lambda (port) (sxml->html sxml port)))) -(define (render-json json) - (list '((content-type . (application/json))) +(define* (render-json json #:key (extra-headers '())) + (list (append extra-headers + '((content-type . (application/json)))) (lambda (port) (scm->json json port)))) |