summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-05 17:39:27 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-05 18:28:44 +0200
commit1591c2cc5af5d5b445b8039db83a124a83367c20 (patch)
treed78c0e80149fc29f7555ae8dbfe39836aa5d6e70
parenta872100b150b21d857d42b4bd0ce88fe19f48385 (diff)
web: redirect: Accept optional query argument.
-rw-r--r--mumi/web/render.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/mumi/web/render.scm b/mumi/web/render.scm
index 61ccde6..7f99731 100644
--- a/mumi/web/render.scm
+++ b/mumi/web/render.scm
@@ -119,12 +119,13 @@
(list (build-response #:code 201)
""))
-(define* (redirect path #:optional (headers '()))
+(define* (redirect path #:optional query (headers '()))
(let ((uri (build-uri 'http
#:host (%config 'host)
#:port (%config 'port)
#:path (string-append
- "/" (encode-and-join-uri-path path)))))
+ "/" (encode-and-join-uri-path path))
+ #:query query)))
(list (build-response
#:code 301
#:headers (append `((content-type . (text/html))