Fixing problem from Alok Thapa

This commit is contained in:
Jay McCarthy 2011-03-07 10:54:06 -07:00
parent 2bdb9884d3
commit 6b907d6b61
2 changed files with 7 additions and 1 deletions

View File

@ -50,6 +50,11 @@
=>
#"HTTP/1.1 200 Okay\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\nConnection: close\r\nhead: value\r\n\r\n<a href=\"#\">link</a>"
(write-response (response/xexpr '(a ([href "#"]) "link")
#:cookies (list (make-cookie "head" "value"))))
=>
#"HTTP/1.1 200 Okay\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\nConnection: close\r\nSet-Cookie: head=value; Version=1\r\n\r\n<a href=\"#\">link</a>"
(write-response (response/xexpr '(a ([href "#"]) "link")
#:preamble #"<<!something XMLy>>"))
=>

View File

@ -3,6 +3,7 @@
racket/list
xml
web-server/private/xexpr
net/cookie
"request-structs.rkt"
"cookie.rkt"
"response-structs.rkt")
@ -27,5 +28,5 @@
(provide/contract
[response/xexpr
((pretty-xexpr/c)
(#:code number? #:message bytes? #:seconds number? #:mime-type bytes? #:headers (listof header?) #:preamble bytes?)
(#:code number? #:message bytes? #:seconds number? #:mime-type bytes? #:cookies (listof cookie?) #:headers (listof header?) #:preamble bytes?)
. ->* . response?)])