зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1520125
- Don't use origin attributes to distinguish proxy authentication cache entries. r=dragana, r=mixedpuppy
This commit is contained in:
Родитель
98de6694fc
Коммит
594d062b4c
|
@ -1542,15 +1542,15 @@ void nsHttpChannelAuthProvider::SetAuthorizationHeader(
|
|||
// or a webserver
|
||||
nsISupports **continuationState;
|
||||
|
||||
nsAutoCString suffix;
|
||||
if (header == nsHttp::Proxy_Authorization) {
|
||||
continuationState = &mProxyAuthContinuationState;
|
||||
} else {
|
||||
continuationState = &mAuthContinuationState;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIChannel> chan = do_QueryInterface(mAuthChannel);
|
||||
nsAutoCString suffix;
|
||||
GetOriginAttributesSuffix(chan, suffix);
|
||||
nsCOMPtr<nsIChannel> chan = do_QueryInterface(mAuthChannel);
|
||||
GetOriginAttributesSuffix(chan, suffix);
|
||||
}
|
||||
|
||||
rv = authCache->GetAuthEntryForPath(scheme, host, port, path, suffix, &entry);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
"use strict";
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "authManager",
|
||||
"@mozilla.org/network/http-auth-manager;1",
|
||||
"nsIHttpAuthManager");
|
||||
|
||||
const proxy = createHttpServer();
|
||||
|
||||
// accept proxy connections for mozilla.org
|
||||
|
@ -74,6 +78,8 @@ add_task(async function test_webRequest_auth_proxy() {
|
|||
await handlingExt.startup();
|
||||
await handlingExt.awaitMessage("pac-ready");
|
||||
|
||||
authManager.clearAll();
|
||||
|
||||
let contentPage = await ExtensionTestUtils.loadContentPage(`http://mozilla.org/`);
|
||||
|
||||
await handlingExt.awaitMessage("done");
|
||||
|
@ -112,12 +118,12 @@ add_task(async function test_webRequest_auth_proxy_system() {
|
|||
xhr.open("GET", url);
|
||||
xhr.onload = () => { resolve(xhr.responseText); };
|
||||
xhr.onerror = () => { reject(xhr.status); };
|
||||
// use a different contextId to avoid auth cache.
|
||||
xhr.setOriginAttributes({userContextId: 1});
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
authManager.clearAll();
|
||||
|
||||
await Promise.all([
|
||||
handlingExt.awaitMessage("onAuthRequired"),
|
||||
fetch("http://mozilla.org"),
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
"use strict";
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "authManager",
|
||||
"@mozilla.org/network/http-auth-manager;1",
|
||||
"nsIHttpAuthManager");
|
||||
|
||||
const proxy = createHttpServer();
|
||||
|
||||
// accept proxy connections for mozilla.org
|
||||
|
@ -76,6 +80,8 @@ add_task(async function test_webRequest_auth_proxy() {
|
|||
await handlingExt.startup();
|
||||
await handlingExt.awaitMessage("ready");
|
||||
|
||||
authManager.clearAll();
|
||||
|
||||
let contentPage = await ExtensionTestUtils.loadContentPage(`http://mozilla.org/`);
|
||||
|
||||
await handlingExt.awaitMessage("done");
|
||||
|
@ -112,6 +118,8 @@ add_task(async function test_webRequest_auth_proxy_system() {
|
|||
await handlingExt.startup();
|
||||
await handlingExt.awaitMessage("ready");
|
||||
|
||||
authManager.clearAll();
|
||||
|
||||
function fetch(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let xhr = new XMLHttpRequest();
|
||||
|
@ -119,8 +127,6 @@ add_task(async function test_webRequest_auth_proxy_system() {
|
|||
xhr.open("GET", url);
|
||||
xhr.onload = () => { resolve(xhr.responseText); };
|
||||
xhr.onerror = () => { reject(xhr.status); };
|
||||
// use a different contextId to avoid auth cache.
|
||||
xhr.setOriginAttributes({userContextId: 1});
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче