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

Unified Diff: net/http/http_stream_parser.cc

Issue 2247003003: Revert HTTP/0.9 removal (https://codereview.chromium.org/2144803002/) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add back new error code Created 4 years, 4 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 f8b5fe995219a331bb351462fd61f6031148eaea..b543af5c68b6bb9b513d82fbe7ba621251865bfd 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -857,12 +857,9 @@ int HttpStreamParser::HandleReadHeaderResult(int result) {
end_offset = read_buf_->offset();
RecordHeaderParserEvent(HEADER_ALLOWED_TRUNCATED_HEADERS);
} else {
- // 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.
+ // The response is apparently using HTTP/0.9. Treat the entire response
+ // as the body.
end_offset = 0;
- // Treat it as an error.
- return ERR_INVALID_HTTP_RESPONSE;
}
int rv = ParseResponseHeaders(end_offset);
if (rv < 0)
@@ -960,8 +957,6 @@ 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