Send a final, empty chunk as required by RFC 2616 in http-conn-send!

This commit is contained in:
Scott Bell 2014-07-16 11:58:09 -07:00 committed by Matthew Flatt
parent 1809df456a
commit 29922c8a77
2 changed files with 2 additions and 2 deletions

View File

@ -245,7 +245,7 @@
["PUT"
(λ (w) (w "fr") (w "ob"))
"HTTP/1.1 200 OK\r\n\r\n"
#"PUT / HTTP/1.1\r\nHost: localhost:REDACTED\r\nUser-Agent: Racket/REDACTED (net/http-client)\r\nAccept-Encoding: gzip\r\nTransfer-Encoding: chunked\r\nConnection: close\r\n\r\n2\r\nfr\r\n2\r\nob\r\n\r\n"
#"PUT / HTTP/1.1\r\nHost: localhost:REDACTED\r\nUser-Agent: Racket/REDACTED (net/http-client)\r\nAccept-Encoding: gzip\r\nTransfer-Encoding: chunked\r\nConnection: close\r\n\r\n2\r\nfr\r\n2\r\nob\r\n0\r\n\r\n"
#"HTTP/1.1 200 OK"
'()
#""]))

View File

@ -136,7 +136,7 @@
(fprintf to "\r\n")
(cond [(procedure? body)
(body (λ (data) (write-chunk to data)))
(fprintf to "\r\n")]
(fprintf to "0\r\n\r\n")]
[body (display body to)])
(flush-output to))