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

Unified Diff: net/http/http_util.cc

Issue 2555813002: Don't consider '\0' as whitespace when parsing HTTP headers. (Closed)
Patch Set: Created 4 years 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 | « no previous file | net/http/http_util_unittest.cc » ('j') | net/http/http_util_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.cc
diff --git a/net/http/http_util.cc b/net/http/http_util.cc
index 99b7192c838d500ce2bec2b783834f0bb94dfd22..61e33ca0ebaac4edc5b4aefe7f40c6305b640bea 100644
--- a/net/http/http_util.cc
+++ b/net/http/http_util.cc
@@ -426,7 +426,8 @@ bool HttpUtil::IsNonCoalescingHeader(std::string::const_iterator name_begin,
}
bool HttpUtil::IsLWS(char c) {
- return strchr(HTTP_LWS, c) != NULL;
+ base::StringPiece kLws(HTTP_LWS);
mmenke 2016/12/06 19:08:24 Needs a const. Also, LWS is one thing, but kLws s
eroman 2016/12/06 19:19:34 Done.
+ return kLws.find(c) != base::StringPiece::npos;
}
// static
« no previous file with comments | « no previous file | net/http/http_util_unittest.cc » ('j') | net/http/http_util_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698