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

Unified Diff: net/http/http_request_headers.cc

Issue 2212883002: Make net::HttpRequestHeaders::AddHeadersFromString split on NL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_request_headers.h ('k') | net/http/http_request_headers_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_request_headers.cc
diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc
index ec01446ef98a2cd61fad7ab0eca954041ffb53f7..235281bebe93df1ed6287405ec845f073e437ea7 100644
--- a/net/http/http_request_headers.cc
+++ b/net/http/http_request_headers.cc
@@ -117,7 +117,7 @@ void HttpRequestHeaders::RemoveHeader(const base::StringPiece& key) {
void HttpRequestHeaders::AddHeaderFromString(
const base::StringPiece& header_line) {
- DCHECK_EQ(std::string::npos, header_line.find("\r\n"))
+ DCHECK_EQ(std::string::npos, header_line.find_first_of("\r\n"))
<< "\"" << header_line << "\" contains CRLF.";
const std::string::size_type key_end_index = header_line.find(":");
@@ -161,7 +161,7 @@ void HttpRequestHeaders::AddHeaderFromString(
void HttpRequestHeaders::AddHeadersFromString(
const base::StringPiece& headers) {
- for (const base::StringPiece& header : base::SplitStringPieceUsingSubstr(
+ for (const base::StringPiece& header : base::SplitStringPiece(
headers, "\r\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
AddHeaderFromString(header);
}
« no previous file with comments | « net/http/http_request_headers.h ('k') | net/http/http_request_headers_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698