diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-30 23:11:43 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-30 23:11:43 +0200 |
commit | 71e6952456e044fef8cd4ab2e1d1b972011a051e (patch) | |
tree | c4b5e1230b13f243dfabcbffd26683dd29b8a974 /docshell/base/nsDocShell.cpp | |
parent | d9abe50072f85d9e890026938d947ebb5e452c65 (diff) | |
download | UXP-71e6952456e044fef8cd4ab2e1d1b972011a051e.tar UXP-71e6952456e044fef8cd4ab2e1d1b972011a051e.tar.gz UXP-71e6952456e044fef8cd4ab2e1d1b972011a051e.tar.lz UXP-71e6952456e044fef8cd4ab2e1d1b972011a051e.tar.xz UXP-71e6952456e044fef8cd4ab2e1d1b972011a051e.zip |
Bug 1341754: Provide a valid triggeringPrincipal when calling SetURI in Location
Diffstat (limited to 'docshell/base/nsDocShell.cpp')
-rw-r--r-- | docshell/base/nsDocShell.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 39a39d917..5c002357f 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -10402,10 +10402,13 @@ nsDocShell::InternalLoad(nsIURI* aURI, * call OnNewURI() so that, this traversal will be * recorded in session and global history. */ - nsCOMPtr<nsIPrincipal> triggeringPrincipal, principalToInherit; + nsCOMPtr<nsIPrincipal> newURITriggeringPrincipal, newURIPrincipalToInherit; if (mOSHE) { - mOSHE->GetTriggeringPrincipal(getter_AddRefs(triggeringPrincipal)); - mOSHE->GetPrincipalToInherit(getter_AddRefs(principalToInherit)); + mOSHE->GetTriggeringPrincipal(getter_AddRefs(newURITriggeringPrincipal)); + mOSHE->GetPrincipalToInherit(getter_AddRefs(newURIPrincipalToInherit)); + } else { + newURITriggeringPrincipal = aTriggeringPrincipal; + newURIPrincipalToInherit = doc->NodePrincipal(); } // Pass true for aCloneSHChildren, since we're not // changing documents here, so all of our subframes are @@ -10415,7 +10418,7 @@ nsDocShell::InternalLoad(nsIURI* aURI, // flag on firing onLocationChange(...). // Anyway, aCloneSHChildren param is simply reflecting // doShortCircuitedLoad in this scope. - OnNewURI(aURI, nullptr, triggeringPrincipal, principalToInherit, + OnNewURI(aURI, nullptr, newURITriggeringPrincipal, newURIPrincipalToInherit, mLoadType, true, true, true); nsCOMPtr<nsIInputStream> postData; |