Backed out changeset 82cd6a486698 (bug 1233245) for fetch-request-redirect.https.html failures CLOSED TREE

This commit is contained in:
Wes Kocher 2015-12-17 16:18:29 -08:00
parent 1dc6fda8b6
commit ed9f67c711
2 changed files with 20 additions and 20 deletions

View File

@ -2012,6 +2012,24 @@ nsHttpChannel::StartRedirectChannelToURI(nsIURI *upgradedURI, uint32_t flags)
// Inform consumers about this fake redirect
mRedirectChannel = newChannel;
if (!(flags & nsIChannelEventSink::REDIRECT_STS_UPGRADE)) {
// Ensure that internally-redirected channels cannot be intercepted, which would look
// like two separate requests to the nsINetworkInterceptController.
if (mInterceptCache == INTERCEPTED) {
nsCOMPtr<nsIHttpChannelInternal> httpRedirect = do_QueryInterface(mRedirectChannel);
if (httpRedirect) {
httpRedirect->ForceIntercepted(mInterceptionID);
}
} else {
nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL;
rv = mRedirectChannel->GetLoadFlags(&loadFlags);
NS_ENSURE_SUCCESS(rv, rv);
loadFlags |= nsIChannel::LOAD_BYPASS_SERVICE_WORKER;
rv = mRedirectChannel->SetLoadFlags(loadFlags);
NS_ENSURE_SUCCESS(rv, rv);
}
}
PushRedirectAsyncFunc(
&nsHttpChannel::ContinueAsyncRedirectChannelToURI);
rv = gHttpHandler->AsyncOnChannelRedirect(this, newChannel, flags);
@ -4587,24 +4605,6 @@ nsHttpChannel::SetupReplacementChannel(nsIURI *newURI,
resumableChannel->ResumeAt(mStartPos, mEntityID);
}
if (!(redirectFlags & nsIChannelEventSink::REDIRECT_STS_UPGRADE)) {
// Ensure that internally-redirected channels cannot be intercepted, which would look
// like two separate requests to the nsINetworkInterceptController.
if (mInterceptCache == INTERCEPTED) {
nsCOMPtr<nsIHttpChannelInternal> httpRedirect = do_QueryInterface(newChannel);
if (httpRedirect) {
httpRedirect->ForceIntercepted(mInterceptionID);
}
} else {
nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL;
rv = newChannel->GetLoadFlags(&loadFlags);
NS_ENSURE_SUCCESS(rv, rv);
loadFlags |= nsIChannel::LOAD_BYPASS_SERVICE_WORKER;
rv = newChannel->SetLoadFlags(loadFlags);
NS_ENSURE_SUCCESS(rv, rv);
}
}
return NS_OK;
}

View File

@ -150,7 +150,7 @@ promise_test(function(t) {
return test_redirect(
OUT_SCOPE + 'url=' + encodeURIComponent(SCOPE1),
SCOPE1,
[[], [], []]);
[[SCOPE1], [], []]);
});
}, 'Normal redirect to same-origin scope.');
promise_test(function(t) {
@ -158,7 +158,7 @@ promise_test(function(t) {
return test_redirect(
OUT_SCOPE + 'url=' + encodeURIComponent(OTHER_ORIGIN_SCOPE),
OTHER_ORIGIN_SCOPE,
[[], [], []]);
[[], [], [OTHER_ORIGIN_SCOPE]]);
});
}, 'Normal redirect to other-origin scope.');