From: Alex Rousskov Date: Mon, 18 Apr 2016 19:08:25 +0000 (-0600) Subject: Stop parsing response prefix after discovering an "HTTP/0.9" response. X-Git-Tag: SQUID_4_0_9~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=617b7ccaa640802a9fc1e23e95726d4279d9556f;p=thirdparty%2Fsquid.git Stop parsing response prefix after discovering an "HTTP/0.9" response. 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. --- diff --git a/src/http/one/ResponseParser.cc b/src/http/one/ResponseParser.cc index 1cf7613de2..7cdbf493cd 100644 --- a/src/http/one/ResponseParser.cc +++ b/src/http/one/ResponseParser.cc @@ -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_);