Fixing recent errors
This commit is contained in:
parent
240dbc3c3d
commit
aaf53cb1d2
|
@ -20,29 +20,29 @@
|
|||
(write-response (response/xexpr '(a ([href "#"]) "link")))
|
||||
=>
|
||||
(bytes-sort
|
||||
#"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\n\r\n<a href=\"#\">link</a>")
|
||||
#"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\n\r\n<a href=\"#\">link</a>")
|
||||
|
||||
(write-response (response/xexpr '(html)))
|
||||
=>
|
||||
(bytes-sort
|
||||
#"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\n\r\n<html></html>")
|
||||
#"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\n\r\n<html></html>")
|
||||
|
||||
(write-response (response/xexpr '(img)))
|
||||
=>
|
||||
(bytes-sort
|
||||
#"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\n\r\n<img />")
|
||||
#"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\n\r\n<img />")
|
||||
|
||||
(write-response (response/xexpr '(a ([href "#"]) "link")
|
||||
#:code 404))
|
||||
=>
|
||||
(bytes-sort
|
||||
#"HTTP/1.1 404 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\n\r\n<a href=\"#\">link</a>")
|
||||
#"HTTP/1.1 404 Okay\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\n\r\n<a href=\"#\">link</a>")
|
||||
|
||||
(write-response (response/xexpr '(a ([href "#"]) "link")
|
||||
#:message #"Bad request"))
|
||||
=>
|
||||
(bytes-sort
|
||||
#"HTTP/1.1 200 Bad request\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\nConnection: close\r\n\r\n<a href=\"#\">link</a>")
|
||||
#"HTTP/1.1 200 Bad request\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\n\r\n<a href=\"#\">link</a>")
|
||||
|
||||
(map
|
||||
(λ (b) (regexp-replace
|
||||
|
@ -60,22 +60,22 @@
|
|||
#:mime-type #"application/xml"))
|
||||
=>
|
||||
(bytes-sort
|
||||
#"HTTP/1.1 200 Okay\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: application/xml\r\nConnection: close\r\n\r\n<a href=\"#\">link</a>")
|
||||
#"HTTP/1.1 200 Okay\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: application/xml\r\n\r\n<a href=\"#\">link</a>")
|
||||
|
||||
(write-response (response/xexpr '(a ([href "#"]) "link")
|
||||
#:headers (list (header #"head" #"value"))))
|
||||
=>
|
||||
(bytes-sort
|
||||
#"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>")
|
||||
#"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\nhead: value\r\n\r\n<a href=\"#\">link</a>")
|
||||
|
||||
(write-response (response/xexpr '(a ([href "#"]) "link")
|
||||
#:cookies (list (make-cookie "head" "value"))))
|
||||
=>
|
||||
(bytes-sort
|
||||
#"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>")
|
||||
#"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\nSet-Cookie: head=value; Version=1\r\n\r\n<a href=\"#\">link</a>")
|
||||
|
||||
(write-response (response/xexpr '(a ([href "#"]) "link")
|
||||
#:preamble #"<<!something XMLy>>"))
|
||||
=>
|
||||
(bytes-sort
|
||||
#"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\n\r\n<<!something XMLy>><a href=\"#\">link</a>"))
|
||||
#"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\n\r\n<<!something XMLy>><a href=\"#\">link</a>"))
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#lang racket
|
||||
(require rackunit
|
||||
racket/submodule
|
||||
net/url
|
||||
web-server/private/connection-manager
|
||||
web-server/private/timer
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#lang racket/base
|
||||
(require racket/submodule
|
||||
rackunit
|
||||
(require rackunit
|
||||
racket/port
|
||||
xml/xml
|
||||
(only-in mzlib/file
|
||||
|
|
Loading…
Reference in New Issue
Block a user