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

Unified Diff: services/http_server/http_request_parser.cc

Issue 2022983003: Roll base to 5e00da80f6adb7082d1c0e88d3274cf87cc43bc5 and tonic to f7acabb8fa6c91124486a41194eac3cd… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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
Index: services/http_server/http_request_parser.cc
diff --git a/services/http_server/http_request_parser.cc b/services/http_server/http_request_parser.cc
index 5aff0d01823370dfd69253c4bb7393e596a4a634..d21107d782f107bfd87b66330702f3869a3088dc 100644
--- a/services/http_server/http_request_parser.cc
+++ b/services/http_server/http_request_parser.cc
@@ -79,8 +79,8 @@ HttpRequestParser::ParseResult HttpRequestParser::ParseHeaders() {
// Request main main header, eg. GET /foobar.html HTTP/1.1
{
const std::string header_line = ShiftLine();
- std::vector<std::string> header_line_tokens;
- base::SplitString(header_line, ' ', &header_line_tokens);
+ std::vector<std::string> header_line_tokens = base::SplitString(
+ header_line, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
DCHECK_EQ(3u, header_line_tokens.size());
// Method.
http_request_->method = header_line_tokens[0];
@@ -89,8 +89,7 @@ HttpRequestParser::ParseResult HttpRequestParser::ParseHeaders() {
// know) anything about the server address.
http_request_->relative_url = header_line_tokens[1];
// Protocol.
- const std::string protocol =
- base::StringToLowerASCII(header_line_tokens[2]);
+ const std::string protocol = base::ToLowerASCII(header_line_tokens[2]);
CHECK(protocol == "http/1.0" || protocol == "http/1.1") <<
"Protocol not supported: " << protocol;
}

Powered by Google App Engine
This is Rietveld 408576698