summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mumi/web/render.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/mumi/web/render.scm b/mumi/web/render.scm
index 02cd648..146a001 100644
--- a/mumi/web/render.scm
+++ b/mumi/web/render.scm
@@ -1,5 +1,5 @@
;;; mumi -- Mediocre, uh, mail interface
-;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016, 2017, 2020 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2014 David Thompson <davet@gnu.org>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -113,7 +113,7 @@
(list (build-response #:code 201)
""))
-(define (redirect path)
+(define* (redirect path #:optional (headers '()))
(let ((uri (build-uri 'http
#:host (%config 'host)
#:port (%config 'port)
@@ -121,6 +121,7 @@
"/" (encode-and-join-uri-path path)))))
(list (build-response
#:code 301
- #:headers `((content-type . (text/html))
- (location . ,uri)))
+ #:headers (append `((content-type . (text/html))
+ (location . ,uri))
+ headers))
(format #f "Redirect to ~a" (uri->string uri)))))