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

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

Issue 1358203003: Normalize and update the header value checks to RFC 7230 for Fetch Base URL: https://chromium.googlesource.com/chromium/src.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
Index: third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp b/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp
index a03e9f3e3d39d1b679f12d5ba463588338253050..4394b74c596bf5d9a7ad24ff2012df50943ebffc 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp
+++ b/third_party/WebKit/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 | « third_party/WebKit/Source/modules/fetch/FetchHeaderList.h ('k') | third_party/WebKit/Source/modules/fetch/Headers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698