Chromium Code Reviews| Index: third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp |
| diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp |
| index 04a20d0b3b80bebd004fc2b34394c1488102de83..2863b7f3f8838c9c92a798122429c3a5ade40549 100644 |
| --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp |
| +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp |
| @@ -165,6 +165,14 @@ bool ResourceLoader::WillFollowRedirect( |
| const ResourceResponse& redirect_response( |
| passed_redirect_response.ToResourceResponse()); |
| + // For main resources, we want to ensure that every step of the redirect chain |
| + // is a valid transition, so set the SecurityOrigin based on the url of the |
| + // redirect source. |
| + if (resource_->GetType() == Resource::kMainResource) { |
| + resource_->MutableOptions().security_origin = |
| + SecurityOrigin::Create(redirect_response.Url()); |
|
kinuko
2017/05/23 13:54:38
For DocumentLoader case I might prefer having this
Nate Chapin
2017/05/23 21:20:50
Moved back to DocumentLoader.
|
| + } |
| + |
| new_request.SetRedirectStatus( |
| ResourceRequest::RedirectStatus::kFollowedRedirect); |