diff --git a/collects/net/doc.txt b/collects/net/doc.txt index d5f51a99a8..bf8977b17f 100644 --- a/collects/net/doc.txt +++ b/collects/net/doc.txt @@ -204,13 +204,13 @@ PROCEDURES ----------------------------------------------------------- The "head.ss" library provides procedures, such as `extract-field, for manipulating the header. - Since web server sometimes return mis-formatted replies, + Since web servers sometimes return mis-formatted replies, `purify-port' is liberal in what it accepts as a header. as a result, the result string may be ill formed, but it will either be the empty string, or it will be a string matching the following regexp: - #rx"^HTTP/.*?((\r\n\r\n)|(\n\n)|(\r\r))" + #rx"^HTTP/.*?(\r\n\r\n|\n\n|\r\r)" > (call/input-url url url->port-proc port->X-proc [list-of-strings]) -> X diff --git a/collects/net/url-unit.ss b/collects/net/url-unit.ss index 3abc1a9207..88f123a582 100644 --- a/collects/net/url-unit.ss +++ b/collects/net/url-unit.ss @@ -312,7 +312,7 @@ ;; purify-port : in-port -> header-string (define (purify-port port) (let ([m (regexp-match-peek-positions - #rx"^HTTP/.*?((\r\n\r\n)|(\n\n)|(\r\r))" port)]) + #rx"^HTTP/.*?(?:\r\n\r\n|\n\n|\r\r)" port)]) (if m (read-string (cdar m) port) ""))) (define character-set-size 256)