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

Unified Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 1506803002: [XHR] Replace isSetCookieHeader() with isForbiddenResponseHeaderName() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index 8b302c8215b172312e8939667b77915e2f523e41..abd426c4ed723a7d1392185c4c76a29d4ee00497 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -100,11 +100,6 @@ private:
int* const m_level;
};
-bool isSetCookieHeader(const AtomicString& name)
-{
- return equalIgnoringCase(name, "set-cookie") || equalIgnoringCase(name, "set-cookie2");
-}
-
void replaceCharsetInMediaType(String& mediaType, const String& charsetValue)
{
unsigned pos = 0, len = 0;
@@ -1236,7 +1231,7 @@ String XMLHttpRequest::getAllResponseHeaders() const
// 2) There's no known harm in hiding Set-Cookie header fields entirely; we don't
// know any widely used technique that requires access to them.
// 3) Firefox has implemented this policy.
yhirano 2015/12/08 07:23:51 Can you update the comments?
tyoshino (SeeGerritForStatus) 2015/12/08 13:21:38 Done.
- if (isSetCookieHeader(it->key) && !securityOrigin()->canLoadLocalResources())
+ if (FetchUtils::isForbiddenResponseHeaderName(it->key) && !securityOrigin()->canLoadLocalResources())
yhirano 2015/12/08 07:23:51 [optional] It would be good to use this function i
tyoshino (SeeGerritForStatus) 2015/12/08 13:21:38 Seems the check in FetchResponseData is unnecessar
continue;
if (!m_sameOriginRequest && !isOnAccessControlResponseHeaderWhitelist(it->key) && !accessControlExposeHeaderSet.contains(it->key))
@@ -1259,7 +1254,7 @@ const AtomicString& XMLHttpRequest::getResponseHeader(const AtomicString& name)
return nullAtom;
// See comment in getAllResponseHeaders above.
- if (isSetCookieHeader(name) && !securityOrigin()->canLoadLocalResources()) {
+ if (FetchUtils::isForbiddenResponseHeaderName(name) && !securityOrigin()->canLoadLocalResources()) {
logConsoleError(executionContext(), "Refused to get unsafe header \"" + name + "\"");
return nullAtom;
}
« 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