Bug 1556489 - P13. Use LoadInfo redirect chain to determine when a channel has redirected and we should skip uri fixup. r=mayhemer

Differential Revision: https://phabricator.services.mozilla.com/D40970
This commit is contained in:
Matt Woodrow 2019-08-06 22:39:28 +10:00 коммит произвёл Jean-Yves Avenard
Родитель 747652aa04
Коммит aa250bb0c7
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -6732,11 +6732,10 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
}
if (doCreateAlternate) {
nsCOMPtr<nsILoadInfo> info = aChannel->LoadInfo();
// Skip doing this if our channel was redirected, because we
// shouldn't be guessing things about the post-redirect URI.
nsLoadFlags loadFlags = 0;
if (NS_FAILED(aChannel->GetLoadFlags(&loadFlags)) ||
(loadFlags & nsIChannel::LOAD_REPLACE)) {
if (!info->RedirectChain().IsEmpty()) {
doCreateAlternate = false;
}
}