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

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

Issue 1304183006: Fail preflight request when redirect is received (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 5 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 | « LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt ('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 c497a11efbbd8a6f6c5da97955cb00b4ac7fe57c..4ff4893a80151d7be4717ce44f1cdafbb36f2a2c 100644
--- a/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/Source/core/loader/DocumentThreadableLoader.cpp
@@ -314,6 +314,19 @@ void DocumentThreadableLoader::redirectReceived(Resource* resource, ResourceRequ
RefPtr<DocumentThreadableLoader> protect(this);
+ if (m_actualRequest) {
+ reportResponseReceived(resource->identifier(), redirectResponse);
+
+ clearResource();
+ request = ResourceRequest();
+
+ m_requestStartedSeconds = 0.0;
+
+ handlePreflightFailure(redirectResponse.url().string(), "Response for preflight is invalid (redirect)");
+
+ return;
+ }
+
if (m_redirectMode == WebURLRequest::FetchRedirectModeManual) {
// We use |m_redirectMode| to check the original redirect mode.
// |request| is a new request for redirect. So we don't set the redirect
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698