From aa250bb0c7aebc4d8889b848598c4940feb9e881 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Tue, 6 Aug 2019 22:39:28 +1000 Subject: [PATCH] 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 --- docshell/base/nsDocShell.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 1c737a8d2676..08f8d17dbbd9 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -6732,11 +6732,10 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress, } if (doCreateAlternate) { + nsCOMPtr 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; } }