diff --git a/pkgs/net-test/tests/net/url-port.rkt b/pkgs/net-test/tests/net/url-port.rkt index 7ce90b40db..86b4fff326 100644 --- a/pkgs/net-test/tests/net/url-port.rkt +++ b/pkgs/net-test/tests/net/url-port.rkt @@ -102,25 +102,25 @@ "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\n\r\n24\r\nThis is the data in the first chunk \r\n1A\r\nand this is the second one\r\n0\r\n") => (values "This is the data in the first chunk and this is the second one" - "Content-Type: text/plain\r\nTransfer-Encoding: chunked\r\n") + "Content-Type: text/plain\r\nTransfer-Encoding: chunked\r\n\r\n") (get-pure/headers "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n\r\nThis is the data in the first chunk and this is the second one") => (values "This is the data in the first chunk and this is the second one" - "Content-Type: text/plain\r\n") + "Content-Type: text/plain\r\n\r\n") (get-pure/headers "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\n\r\n20\r\nThis is the data in the first ch\r\n21\r\nand this is the second oneXXXXXXX\r\n0\r\n") => (values "This is the data in the first chand this is the second oneXXXXXXX" - "Content-Type: text/plain\r\nTransfer-Encoding: chunked\r\n") + "Content-Type: text/plain\r\nTransfer-Encoding: chunked\r\n\r\n") (get-pure/headers "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\nAnother-Header: ta-daa\r\n\r\n20\r\nThis is the data in the first ch\r\n21\r\nand this is the second oneXXXXXXX\r\n0\r\n") => (values "This is the data in the first chand this is the second oneXXXXXXX" - "Content-Type: text/plain\r\nTransfer-Encoding: chunked\r\nAnother-Header: ta-daa\r\n") + "Content-Type: text/plain\r\nTransfer-Encoding: chunked\r\nAnother-Header: ta-daa\r\n\r\n") ) (unless skip-actual-redirect? @@ -135,7 +135,7 @@ "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\nAnother-Header: ta-daa\r\n\r\n20\r\nThis is the data in the first ch\r\n21\r\nand this is the second oneXXXXXXX\r\n0\r\n") => (values "This is the data in the first chand this is the second oneXXXXXXX" - "Content-Type: text/plain\r\nTransfer-Encoding: chunked\r\nAnother-Header: ta-daa\r\n"))) + "Content-Type: text/plain\r\nTransfer-Encoding: chunked\r\nAnother-Header: ta-daa\r\n\r\n"))) (test (put-pure diff --git a/racket/collects/net/url.rkt b/racket/collects/net/url.rkt index 9d3466568c..1f5e3aaca9 100644 --- a/racket/collects/net/url.rkt +++ b/racket/collects/net/url.rkt @@ -338,11 +338,12 @@ (redirection-loop (- redirections 1) new-url #f)] [else (values response-port - (apply string-append - (map (λ (x) (format "~a\r\n" x)) - (if status? - (cons status headers) - headers))))]))) + (string-append (apply string-append + (map (λ (x) (format "~a\r\n" x)) + (if status? + (cons status headers) + headers))) + "\r\n"))]))) ;; get-pure-port : url [x list (str)] -> in-port (define (get-pure-port url [strings '()] #:redirections [redirections 0])