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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp

Issue 2635023003: Fix a bug in origin header generation for CORS preflight in extensions (Closed)
Patch Set: Rebase Created 3 years, 11 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 | « third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp ('k') | 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/loader/DocumentThreadableLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
index cd542a6b764249f938680e4c78ccff602cf896f5..885be895e4535404c983aa8bc722a9679c31399d 100644
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
@@ -455,16 +455,15 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest(
effectiveAllowCredentials(), crossOriginRequest.httpMethod(),
crossOriginRequest.httpHeaderFields());
if (canSkipPreflight && !shouldForcePreflight) {
- if (getSecurityOrigin())
- crossOriginRequest.setHTTPOrigin(getSecurityOrigin());
- if (m_overrideReferrer)
- crossOriginRequest.setHTTPReferrer(m_referrerAfterRedirect);
-
prepareCrossOriginRequest(crossOriginRequest);
loadRequest(crossOriginRequest, crossOriginOptions);
} else {
- ResourceRequest preflightRequest = createAccessControlPreflightRequest(
- crossOriginRequest, getSecurityOrigin());
+ ResourceRequest preflightRequest =
+ createAccessControlPreflightRequest(crossOriginRequest);
+ // TODO(tyoshino): Call prepareCrossOriginRequest(preflightRequest) to
+ // also set the referrer header.
+ if (getSecurityOrigin())
+ preflightRequest.setHTTPOrigin(getSecurityOrigin());
// Create a ResourceLoaderOptions for preflight.
ResourceLoaderOptions preflightOptions = crossOriginOptions;
@@ -473,7 +472,6 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest(
m_actualRequest = crossOriginRequest;
m_actualOptions = crossOriginOptions;
- prepareCrossOriginRequest(crossOriginRequest);
loadRequest(preflightRequest, preflightOptions);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698