web-redirect/temporary!
This commit is contained in:
parent
4b99b629df
commit
3ce8bc380b
|
@ -30,6 +30,7 @@
|
|||
web-respond/bytes!
|
||||
web-respond/string!
|
||||
web-respond/xexpr!
|
||||
web-redirect/temporary!
|
||||
|
||||
append-url-path
|
||||
|
||||
|
@ -160,6 +161,18 @@
|
|||
(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)))])
|
||||
(web-respond/xexpr! id
|
||||
#:header (make-web-response-header
|
||||
#:code 303
|
||||
#:message #"Moved"
|
||||
#:headers (list (cons 'location location)
|
||||
(cons 'content-type content-type)))
|
||||
body))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define web-server-max-waiting (make-parameter 511)) ;; sockets
|
||||
|
|
Loading…
Reference in New Issue