]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Stop parsing response prefix after discovering an "HTTP/0.9" response.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 18 Apr 2016 19:08:25 +0000 (13:08 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 18 Apr 2016 19:08:25 +0000 (13:08 -0600)
Otherwise, our "X-Transformed-From: HTTP/0.9" headers are going to
be ignored, and the rest of the received bytes are going to be parsed
(and modified!) as an HTTP/1 response header, followed by message body.

src/http/one/ResponseParser.cc

index 1cf7613de22beddf391a8e247594cb9e78448e37..7cdbf493cd2fc30700e76a391d45c5b67bdbb840 100644 (file)
@@ -219,7 +219,7 @@ Http::One::ResponseParser::parse(const SBuf &aBuf)
         const int retcode = parseResponseFirstLine();
 
         // first-line (or a look-alike) found successfully.
-        if (retcode > 0)
+        if (retcode > 0 && parsingStage_ == HTTP_PARSE_FIRST)
             parsingStage_ = HTTP_PARSE_MIME;
         debugs(74, 5, "status-line: retval " << retcode);
         debugs(74, 5, "status-line: proto " << msgProtocol_);