зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1620647 - Refactor nsHttpChannelAuthProvider r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D65762 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
c5217006a9
Коммит
59362e319c
|
@ -931,17 +931,13 @@ bool nsHttpChannelAuthProvider::BlockPrompt(bool proxyAuth) {
|
|||
if (!topDoc && !xhr) {
|
||||
nsCOMPtr<nsIURI> topURI;
|
||||
Unused << chanInternal->GetTopWindowURI(getter_AddRefs(topURI));
|
||||
|
||||
if (!topURI) {
|
||||
// If we do not have topURI try the loadingPrincipal.
|
||||
nsCOMPtr<nsIPrincipal> loadingPrinc = loadInfo->LoadingPrincipal();
|
||||
if (loadingPrinc) {
|
||||
loadingPrinc->GetURI(getter_AddRefs(topURI));
|
||||
}
|
||||
}
|
||||
|
||||
if (!NS_SecurityCompareURIs(topURI, mURI, true)) {
|
||||
mCrossOrigin = true;
|
||||
nsCOMPtr<nsIPrincipal> loadingPrinc = loadInfo->LoadingPrincipal();
|
||||
if (topURI) {
|
||||
mCrossOrigin = !NS_SecurityCompareURIs(topURI, mURI, true);
|
||||
} else {
|
||||
bool sameOrigin = false;
|
||||
loadingPrinc->IsSameOrigin(mURI, false, &sameOrigin);
|
||||
mCrossOrigin = !sameOrigin;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче