| Index: net/http/http_stream_parser.cc
|
| diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
|
| index b673689ed296c510ab1a7d89f764c5424235e5c9..bb0f1f218acc5ba5a34c84772b3b906ce24e4dcf 100644
|
| --- a/net/http/http_stream_parser.cc
|
| +++ b/net/http/http_stream_parser.cc
|
| @@ -832,9 +832,12 @@ int HttpStreamParser::HandleReadHeaderResult(int result) {
|
| end_offset = read_buf_->offset();
|
| RecordHeaderParserEvent(HEADER_ALLOWED_TRUNCATED_HEADERS);
|
| } else {
|
| - // The response is apparently using HTTP/0.9. Treat the entire response
|
| - // as the body.
|
| + // The server is apparently returning a very short HTTP/0.9 response.
|
| + // TODO(mmenke): Clean up remnants of HTTP/0.9 code once HTTP/0.9 removal
|
| + // successfully ships.
|
| end_offset = 0;
|
| + // Treat it as an error.
|
| + return ERR_INVALID_HTTP_RESPONSE;
|
| }
|
| int rv = ParseResponseHeaders(end_offset);
|
| if (rv < 0)
|
| @@ -932,6 +935,8 @@ int HttpStreamParser::FindAndParseResponseHeaders() {
|
| // Enough data to decide that this is an HTTP/0.9 response.
|
| // 8 bytes = (4 bytes of junk) + "http".length()
|
| end_offset = 0;
|
| + // Treat a an error.
|
| + return ERR_INVALID_HTTP_RESPONSE;
|
| }
|
|
|
| if (end_offset == -1)
|
|
|