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

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

Issue 379113002: Move fetch-related predicates to core/fetch. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 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
Index: Source/modules/serviceworkers/FetchHeaderList.cpp
diff --git a/Source/modules/serviceworkers/FetchHeaderList.cpp b/Source/modules/serviceworkers/FetchHeaderList.cpp
index 5eddc105521018c6ffd4bded6567575159c8256c..59b99b5336d23702a086c3a070a344d9e1365de9 100644
--- a/Source/modules/serviceworkers/FetchHeaderList.cpp
+++ b/Source/modules/serviceworkers/FetchHeaderList.cpp
@@ -6,7 +6,6 @@
#include "FetchHeaderList.h"
#include "core/fetch/CrossOriginAccessControl.h"
-#include "core/xml/XMLHttpRequest.h"
#include "platform/network/HTTPParsers.h"
#include "wtf/PassOwnPtr.h"
@@ -135,46 +134,4 @@ bool FetchHeaderList::isValidHeaderValue(const String& value)
return isValidHTTPHeaderValue(value);
}
-bool FetchHeaderList::isSimpleHeader(const String& name, const String& value)
-{
- // "A simple header is a header whose name is either one of `Accept`,
- // `Accept-Language`, and `Content-Language`, or whose name is
- // `Content-Type` and value, once parsed, is one of
- // `application/x-www-form-urlencoded`, `multipart/form-data`, and
- // `text/plain`."
- if (equalIgnoringCase(name, "accept")
- || equalIgnoringCase(name, "accept-language")
- || equalIgnoringCase(name, "content-language"))
- return true;
-
- if (equalIgnoringCase(name, "content-type")) {
- AtomicString mimeType = extractMIMETypeFromMediaType(AtomicString(value));
- return equalIgnoringCase(mimeType, "application/x-www-form-urlencoded")
- || equalIgnoringCase(mimeType, "multipart/form-data")
- || equalIgnoringCase(mimeType, "text/plain");
- }
-
- return false;
-}
-
-bool FetchHeaderList::isForbiddenHeaderName(const String& name)
-{
- // "A forbidden header name is a header names that is one of:
- // `Accept-Charset`, `Accept-Encoding`, `Access-Control-Request-Headers`,
- // `Access-Control-Request-Method`, `Connection`,
- // `Content-Length, Cookie`, `Cookie2`, `Date`, `DNT`, `Expect`, `Host`,
- // `Keep-Alive`, `Origin`, `Referer`, `TE`, `Trailer`,
- // `Transfer-Encoding`, `Upgrade`, `User-Agent`, `Via`
- // or starts with `Proxy-` or `Sec-` (including when it is just `Proxy-` or
- // `Sec-`)."
- return !XMLHttpRequest::isAllowedHTTPHeader(name) || equalIgnoringCase(name, "DNT");
-}
-
-bool FetchHeaderList::isForbiddenResponseHeaderName(const String& name)
-{
- // "A forbidden response header name is a header name that is one of:
- // `Set-Cookie`, `Set-Cookie2`"
- return equalIgnoringCase(name, "set-cookie") || equalIgnoringCase(name, "set-cookie2");
-}
-
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698