mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1233245 - Propagate the interception information in the non-e10s case for all HTTP redirects, not just the internal ones; r=jdm
Doing this work in StartRedirectChannelToURI() was causing us to not set the bypass service worker flag properly in the case of real HTTP redirects. This patch also fixes the incorrect test expectation value.
This commit is contained in:
parent
58e5906185
commit
0de497f00c
@ -2012,21 +2012,12 @@ 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);
|
||||
if (!(flags & nsIChannelEventSink::REDIRECT_STS_UPGRADE) &&
|
||||
mInterceptCache == INTERCEPTED) {
|
||||
// Mark the channel as intercepted in order to propagate the response URL.
|
||||
nsCOMPtr<nsIHttpChannelInternal> httpRedirect = do_QueryInterface(mRedirectChannel);
|
||||
if (httpRedirect) {
|
||||
httpRedirect->ForceIntercepted(mInterceptionID);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4605,6 +4596,18 @@ nsHttpChannel::SetupReplacementChannel(nsIURI *newURI,
|
||||
resumableChannel->ResumeAt(mStartPos, mEntityID);
|
||||
}
|
||||
|
||||
if (!(redirectFlags & nsIChannelEventSink::REDIRECT_STS_UPGRADE) &&
|
||||
mInterceptCache != INTERCEPTED) {
|
||||
// Ensure that internally-redirected channels cannot be intercepted, which would look
|
||||
// like two separate requests to the nsINetworkInterceptController.
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -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.');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user