Enable passing extra headers for JSON responses

Mostly to enable passing the cache-control header.
This commit is contained in:
Christopher Baines 2019-05-18 20:25:05 +01:00
parent 03faff5da0
commit 0ca5748c0f
1 changed files with 3 additions and 2 deletions

View File

@ -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))))