up
svn: r3946
This commit is contained in:
parent
0cf62c196a
commit
f27bba6bd8
|
@ -78,7 +78,7 @@
|
||||||
`("Date: " ,(seconds->gmt-string (current-seconds)))
|
`("Date: " ,(seconds->gmt-string (current-seconds)))
|
||||||
`("Last-Modified: " ,(seconds->gmt-string seconds))
|
`("Last-Modified: " ,(seconds->gmt-string seconds))
|
||||||
`("Server: PLT Scheme")
|
`("Server: PLT Scheme")
|
||||||
`("Content-type: " ,mime)
|
`("Content-Type: " ,mime)
|
||||||
(if (connection-close? conn)
|
(if (connection-close? conn)
|
||||||
(cons `("Connection: close") extras)
|
(cons `("Connection: close") extras)
|
||||||
extras)))
|
extras)))
|
||||||
|
@ -192,7 +192,7 @@
|
||||||
;; output-file: connection path symbol bytes -> void
|
;; output-file: connection path symbol bytes -> void
|
||||||
(define (output-file conn file-path method mime-type)
|
(define (output-file conn file-path method mime-type)
|
||||||
(output-headers conn 200 "Okay"
|
(output-headers conn 200 "Okay"
|
||||||
`(("Content-length: " ,(file-size file-path)))
|
`(("Content-Length: " ,(file-size file-path)))
|
||||||
(file-or-directory-modify-seconds file-path)
|
(file-or-directory-modify-seconds file-path)
|
||||||
mime-type)
|
mime-type)
|
||||||
(when (eq? method 'get)
|
(when (eq? method 'get)
|
||||||
|
@ -211,7 +211,7 @@
|
||||||
(define (output-response/method conn resp meth)
|
(define (output-response/method conn resp meth)
|
||||||
(cond
|
(cond
|
||||||
[(eqv? meth 'head)
|
[(eqv? meth 'head)
|
||||||
(output-headers/response conn resp `(("Content-length: "
|
(output-headers/response conn resp `(("Content-Length: "
|
||||||
,(response/full->size resp))))]
|
,(response/full->size resp))))]
|
||||||
[else
|
[else
|
||||||
(output-response conn resp)]))
|
(output-response conn resp)]))
|
||||||
|
@ -235,7 +235,7 @@
|
||||||
;; Write a normal response to an output port
|
;; Write a normal response to an output port
|
||||||
(define (output-response/basic conn resp size responder)
|
(define (output-response/basic conn resp size responder)
|
||||||
(output-headers/response conn resp
|
(output-headers/response conn resp
|
||||||
`(("Content-length: " ,size)
|
`(("Content-Length: " ,size)
|
||||||
. ,(extras->strings resp)))
|
. ,(extras->strings resp)))
|
||||||
(responder (connection-o-port conn)))
|
(responder (connection-o-port conn)))
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
(lambda (k-url)
|
(lambda (k-url)
|
||||||
`(html (head ,head-attributes
|
`(html (head ,head-attributes
|
||||||
(meta ([http-equiv "Pragma"] [content "no-cache"])) ; don't cache in netscape
|
(meta ([http-equiv "Pragma"] [content "no-cache"])) ; don't cache in netscape
|
||||||
(meta ([http-equiv "expires"] [content "-1"])) ; don't cache in IE
|
(meta ([http-equiv "Expires"] [content "-1"])) ; don't cache in IE
|
||||||
; one site said to use -1, another said to use 0.
|
; one site said to use -1, another said to use 0.
|
||||||
(title . ,title))
|
(title . ,title))
|
||||||
(body ,body-attributes
|
(body ,body-attributes
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
(make-response/full (redirection-status-code perm/temp)
|
(make-response/full (redirection-status-code perm/temp)
|
||||||
(redirection-status-message perm/temp)
|
(redirection-status-message perm/temp)
|
||||||
(current-seconds) #"text/html"
|
(current-seconds) #"text/html"
|
||||||
`((location . ,uri)) (list (redirect-page uri)))))
|
`((Location . ,uri)) (list (redirect-page uri)))))
|
||||||
|
|
||||||
; : str -> str
|
; : str -> str
|
||||||
(define (redirect-page url)
|
(define (redirect-page url)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user