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

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

Issue 23582002: CORS: Update the redirection status in Inspector Network tab for CORS requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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/inspector/InspectorResourceAgent.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/DocumentThreadableLoader.cpp
diff --git a/Source/core/loader/DocumentThreadableLoader.cpp b/Source/core/loader/DocumentThreadableLoader.cpp
index 247f43c8bb743553d9e07826b945988685f3c213..c3e0a3ceb1a4ae68db7ddb744adb81b891403bab 100644
--- a/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/Source/core/loader/DocumentThreadableLoader.cpp
@@ -206,13 +206,18 @@ void DocumentThreadableLoader::redirectReceived(Resource* resource, ResourceRequ
// scheme and not contain the userinfo production. In addition, the redirect response must pass the access control check if the
// original request was not same-origin.
if (m_options.crossOriginRequestPolicy == UseAccessControl) {
+
+ InspectorInstrumentation::didReceiveCORSRedirectResponse(m_document->frame(), resource->identifier(), m_document->frame()->loader()->documentLoader(), redirectResponse, 0, resource->loadFinishTime());
eustas 2013/08/28 09:43:25 I'm not sure that it is legal to use resource->loa
ancilgeorge 2013/08/28 14:05:11 I agree that finish time will not be updated in th
+
bool allowRedirect = false;
+ String accessControlErrorDescription;
if (m_simpleRequest) {
- String accessControlErrorDescription;
allowRedirect = SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())
&& request.url().user().isEmpty()
&& request.url().pass().isEmpty()
&& (m_sameOriginRequest || passesAccessControlCheck(redirectResponse, m_options.allowCredentials, securityOrigin(), accessControlErrorDescription));
+ } else {
+ accessControlErrorDescription = "Cross Origin Requests with preflight cannot be redirected";
}
if (allowRedirect) {
@@ -243,9 +248,12 @@ void DocumentThreadableLoader::redirectReceived(Resource* resource, ResourceRequ
makeCrossOriginAccessRequest(request);
return;
}
- }
- m_client->didFailRedirectCheck();
+ ResourceError error(errorDomainWebKitInternal, 0, redirectResponse.url().string(), accessControlErrorDescription);
+ m_client->didFailAccessControlCheck(error);
+ } else {
+ m_client->didFailRedirectCheck();
+ }
request = ResourceRequest();
}
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698