Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(846)

Unified Diff: net/http/http_stream_parser.cc

Issue 2144803002: Remove HTTP/0.9 support from HttpStreamParser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix websockets tests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_stream_parser_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_stream_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698