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

Unified Diff: net/http/http_request_headers.cc

Issue 2143903002: Make calling SetHeader() with invalid value fatal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | 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 c6fcaad6366e7facaffb0fdc145460db87a87b89..ec01446ef98a2cd61fad7ab0eca954041ffb53f7 100644
--- a/net/http/http_request_headers.cc
+++ b/net/http/http_request_headers.cc
@@ -90,7 +90,8 @@ void HttpRequestHeaders::Clear() {
void HttpRequestHeaders::SetHeader(const base::StringPiece& key,
const base::StringPiece& value) {
DCHECK(HttpUtil::IsValidHeaderName(key.as_string()));
- DCHECK(HttpUtil::IsValidHeaderValue(value.as_string()));
+ // TODO(ricea): Revert this. See crbug.com/627398.
+ CHECK(HttpUtil::IsValidHeaderValue(value.as_string()));
HeaderVector::iterator it = FindHeader(key);
if (it != headers_.end())
it->value.assign(value.data(), value.size());
@@ -101,7 +102,8 @@ void HttpRequestHeaders::SetHeader(const base::StringPiece& key,
void HttpRequestHeaders::SetHeaderIfMissing(const base::StringPiece& key,
const base::StringPiece& value) {
DCHECK(HttpUtil::IsValidHeaderName(key.as_string()));
- DCHECK(HttpUtil::IsValidHeaderValue(value.as_string()));
+ // TODO(ricea): Revert this. See crbug.com/627398.
+ CHECK(HttpUtil::IsValidHeaderValue(value.as_string()));
HeaderVector::iterator it = FindHeader(key);
if (it == headers_.end())
headers_.push_back(HeaderKeyValuePair(key, value));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698