summaryrefslogtreecommitdiffstats
path: root/netwerk/base/nsPACMan.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /netwerk/base/nsPACMan.cpp
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/base/nsPACMan.cpp')
-rw-r--r--netwerk/base/nsPACMan.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/netwerk/base/nsPACMan.cpp b/netwerk/base/nsPACMan.cpp
index 0cf66c8ee6..d4c6c4bd79 100644
--- a/netwerk/base/nsPACMan.cpp
+++ b/netwerk/base/nsPACMan.cpp
@@ -502,6 +502,13 @@ nsresult nsPACMan::PostQuery(PendingPACQuery* query) {
return NS_OK;
}
+// check if proxy settings are configured for WPAD
+bool IsProxyConfigValidForWPAD(int proxyConfigType, bool wpadSystemSettings) {
+ return proxyConfigType == nsIProtocolProxyService::PROXYCONFIG_WPAD ||
+ (proxyConfigType == nsIProtocolProxyService::PROXYCONFIG_SYSTEM &&
+ wpadSystemSettings);
+}
+
nsresult nsPACMan::LoadPACFromURI(const nsACString& aSpec) {
return LoadPACFromURI(aSpec, true);
}
@@ -541,7 +548,7 @@ nsresult nsPACMan::LoadPACFromURI(const nsACString& aSpec,
if (NS_FAILED(rv)) {
return rv;
}
- if (mProxyConfigType != nsIProtocolProxyService::PROXYCONFIG_WPAD) {
+ if (!IsProxyConfigValidForWPAD(mProxyConfigType, mAutoDetect)) {
LOG(
("LoadPACFromURI - Aborting WPAD autodetection because the pref "
"doesn't match anymore"));
@@ -595,7 +602,7 @@ nsresult nsPACMan::GetPACFromDHCP(nsACString& aSpec) {
nsresult nsPACMan::ConfigureWPAD(nsACString& aSpec) {
MOZ_ASSERT(!NS_IsMainThread(), "wrong thread");
- if (mProxyConfigType != nsIProtocolProxyService::PROXYCONFIG_WPAD) {
+ if (!IsProxyConfigValidForWPAD(mProxyConfigType, mAutoDetect)) {
LOG(
("ConfigureWPAD - Aborting WPAD autodetection because the pref "
"doesn't match anymore"));