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

Unified Diff: Source/modules/fetch/FetchHeaderList.cpp

Issue 1288263003: Normalize and update the header value checks to RFC 7230 for Fetch Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « Source/modules/fetch/FetchHeaderList.h ('k') | Source/modules/fetch/Headers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/FetchHeaderList.cpp
diff --git a/Source/modules/fetch/FetchHeaderList.cpp b/Source/modules/fetch/FetchHeaderList.cpp
index a03e9f3e3d39d1b679f12d5ba463588338253050..c1a2f1c19cbaed24e36a19bad5b3d6db313cef6e 100644
--- a/Source/modules/fetch/FetchHeaderList.cpp
+++ b/Source/modules/fetch/FetchHeaderList.cpp
@@ -149,11 +149,13 @@ bool FetchHeaderList::isValidHeaderName(const String& name)
return isValidHTTPToken(name);
}
-bool FetchHeaderList::isValidHeaderValue(const String& value)
+bool FetchHeaderList::isValidHeaderValueRFC7230(const String& value)
{
- // "A value is a byte sequence that matches the field-value token production
- // and contains no 0x0A or 0x0D bytes."
- return isValidHTTPHeaderValue(value);
+ // checks the header value according to the latest Fetch API's header
+ // value definition (https://fetch.spec.whatwg.org/#concept-header-value) and RFC
+ // 7230 and it is different from isValidHTTPHeaderValue().
+
+ return value.isEmpty() || isValidHTTPFieldContentRFC7230(value);
}
} // namespace blink
« no previous file with comments | « Source/modules/fetch/FetchHeaderList.h ('k') | Source/modules/fetch/Headers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698