web-redirect/temporary! -> web-redirect!

This commit is contained in:
Tony Garnock-Jones 2016-11-23 15:39:11 +13:00
parent 3ce8bc380b
commit 0d34e3280e
1 changed files with 9 additions and 7 deletions

View File

@ -30,7 +30,7 @@
web-respond/bytes!
web-respond/string!
web-respond/xexpr!
web-redirect/temporary!
web-redirect!
append-url-path
@ -161,14 +161,16 @@
(bytes-append preamble
(string->bytes/utf-8 (xexpr->string body-xexpr)))))
(define (web-redirect/temporary! id location
#:content-type [content-type "text/html"]
#:body [body `(html (body (a ((href ,location))
"Moved to " ,location)))])
(define (web-redirect! id location
#:code [code 303]
#:message [message #"Redirect"]
#:content-type [content-type "text/html"]
#:body [body `(html (body (a ((href ,location))
"Moved to " ,location)))])
(web-respond/xexpr! id
#:header (make-web-response-header
#:code 303
#:message #"Moved"
#:code code
#:message message
#:headers (list (cons 'location location)
(cons 'content-type content-type)))
body))