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

Unified Diff: Source/core/loader/PingLoader.cpp

Issue 314093002: Remove the setting of first party for cookies from addAdditionalRequestHeaders (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed compilation error Created 6 years, 6 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/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/PingLoader.cpp
diff --git a/Source/core/loader/PingLoader.cpp b/Source/core/loader/PingLoader.cpp
index 780587c72f213f71b28e2704c18801851def916d..8ff904d76c2b0745e4e19d0a66d1e8c1bf12de86 100644
--- a/Source/core/loader/PingLoader.cpp
+++ b/Source/core/loader/PingLoader.cpp
@@ -66,6 +66,7 @@ void PingLoader::loadImage(LocalFrame* frame, const KURL& url)
request.setTargetType(ResourceRequest::TargetIsPing);
request.setHTTPHeaderField("Cache-Control", "max-age=0");
frame->loader().fetchContext().addAdditionalRequestHeaders(frame->document(), request, FetchSubresource);
+ frame->loader().fetchContext().setFirstPartyForCookies(request);
FetchInitiatorInfo initiatorInfo;
initiatorInfo.name = FetchInitiatorTypeNames::ping;
@@ -82,6 +83,7 @@ void PingLoader::sendLinkAuditPing(LocalFrame* frame, const KURL& pingURL, const
request.setHTTPBody(FormData::create("PING"));
request.setHTTPHeaderField("Cache-Control", "max-age=0");
frame->loader().fetchContext().addAdditionalRequestHeaders(frame->document(), request, FetchSubresource);
+ frame->loader().fetchContext().setFirstPartyForCookies(request);
RefPtr<SecurityOrigin> pingOrigin = SecurityOrigin::create(pingURL);
// addAdditionalRequestHeaders() will have added a referrer for same origin requests,
@@ -109,6 +111,7 @@ void PingLoader::sendViolationReport(LocalFrame* frame, const KURL& reportURL, P
request.setHTTPContentType(type == ContentSecurityPolicyViolationReport ? "application/csp-report" : "application/json");
request.setHTTPBody(report);
frame->loader().fetchContext().addAdditionalRequestHeaders(frame->document(), request, FetchSubresource);
+ frame->loader().fetchContext().setFirstPartyForCookies(request);
FetchInitiatorInfo initiatorInfo;
initiatorInfo.name = FetchInitiatorTypeNames::violationreport;
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698