зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1722942
use beConservative for proxy failover to direct r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D121234
This commit is contained in:
Родитель
afdc2b3bcc
Коммит
728ee84a7d
|
@ -2652,9 +2652,8 @@ nsresult nsHttpChannel::ProxyFailover() {
|
|||
return rv;
|
||||
}
|
||||
// If this request used a failed proxy and there is no failover available,
|
||||
// fallback to DIRECT connections for system principal requests.
|
||||
if (mLoadInfo->GetLoadingPrincipal() &&
|
||||
mLoadInfo->GetLoadingPrincipal()->IsSystemPrincipal()) {
|
||||
// fallback to DIRECT connections for conservative requests.
|
||||
if (LoadBeConservative()) {
|
||||
rv = pps->NewProxyInfo("direct"_ns, ""_ns, 0, ""_ns, ""_ns, 0, UINT32_MAX,
|
||||
nullptr, getter_AddRefs(pi));
|
||||
}
|
||||
|
|
|
@ -42,8 +42,9 @@ function getBadProxyPort() {
|
|||
|
||||
function xhr(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let req = new XMLHttpRequest({ mozSystem: true });
|
||||
let req = new XMLHttpRequest();
|
||||
req.open("GET", `${url}?t=${Math.random()}`);
|
||||
req.channel.QueryInterface(Ci.nsIHttpChannelInternal).beConservative = true;
|
||||
req.onload = () => {
|
||||
resolve(req.responseText);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче