mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-22 08:27:31 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
e5ac12c311
5 changed files with 26 additions and 2 deletions
|
|
@ -48,6 +48,7 @@ static const char kPrefIPv4OnlyDomains[] = "network.dns.ipv4OnlyDomains";
|
|||
static const char kPrefDisableIPv6[] = "network.dns.disableIPv6";
|
||||
static const char kPrefDisablePrefetch[] = "network.dns.disablePrefetch";
|
||||
static const char kPrefBlockDotOnion[] = "network.dns.blockDotOnion";
|
||||
static const char kPrefBlockQuad0[] = "network.dns.blockQuad0";
|
||||
static const char kPrefDnsLocalDomains[] = "network.dns.localDomains";
|
||||
static const char kPrefDnsOfflineLocalhost[] = "network.dns.offline-localhost";
|
||||
static const char kPrefDnsNotifyResolution[] = "network.dns.notifyResolution";
|
||||
|
|
@ -537,6 +538,7 @@ nsDNSService::Init()
|
|||
bool offlineLocalhost = true;
|
||||
bool disablePrefetch = false;
|
||||
bool blockDotOnion = true;
|
||||
bool blockQuad0 = false;
|
||||
int proxyType = nsIProtocolProxyService::PROXYCONFIG_DIRECT;
|
||||
bool notifyResolution = false;
|
||||
|
||||
|
|
@ -561,6 +563,7 @@ nsDNSService::Init()
|
|||
prefs->GetBoolPref(kPrefDnsOfflineLocalhost, &offlineLocalhost);
|
||||
prefs->GetBoolPref(kPrefDisablePrefetch, &disablePrefetch);
|
||||
prefs->GetBoolPref(kPrefBlockDotOnion, &blockDotOnion);
|
||||
prefs->GetBoolPref(kPrefBlockQuad0, &blockQuad0);
|
||||
|
||||
// If a manual proxy is in use, disable prefetch implicitly
|
||||
prefs->GetIntPref("network.proxy.type", &proxyType);
|
||||
|
|
@ -579,6 +582,7 @@ nsDNSService::Init()
|
|||
prefs->AddObserver(kPrefDnsOfflineLocalhost, this, false);
|
||||
prefs->AddObserver(kPrefDisablePrefetch, this, false);
|
||||
prefs->AddObserver(kPrefBlockDotOnion, this, false);
|
||||
prefs->AddObserver(kPrefBlockQuad0, this, false);
|
||||
prefs->AddObserver(kPrefDnsNotifyResolution, this, false);
|
||||
|
||||
// Monitor these to see if there is a change in proxy configuration
|
||||
|
|
@ -612,6 +616,7 @@ nsDNSService::Init()
|
|||
mOfflineLocalhost = offlineLocalhost;
|
||||
mDisableIPv6 = disableIPv6;
|
||||
mBlockDotOnion = blockDotOnion;
|
||||
mBlockQuad0 = blockQuad0;
|
||||
|
||||
// Disable prefetching either by explicit preference or if a manual proxy is configured
|
||||
mDisablePrefetch = disablePrefetch || (proxyType == nsIProtocolProxyService::PROXYCONFIG_MANUAL);
|
||||
|
|
@ -697,6 +702,14 @@ nsDNSService::PreprocessHostname(bool aLocalDomain,
|
|||
return NS_ERROR_UNKNOWN_HOST;
|
||||
}
|
||||
|
||||
// Block access to the "this machine" address.
|
||||
if (mBlockQuad0 &&
|
||||
(aInput.EqualsLiteral("0.0.0.0") ||
|
||||
aInput.EqualsLiteral("::") ||
|
||||
aInput.EqualsLiteral("::0.0.0.0"))) {
|
||||
return NS_ERROR_UNKNOWN_HOST;
|
||||
}
|
||||
|
||||
if (aLocalDomain) {
|
||||
aACE.AssignLiteral("localhost");
|
||||
return NS_OK;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ private:
|
|||
bool mDisableIPv6;
|
||||
bool mDisablePrefetch;
|
||||
bool mBlockDotOnion;
|
||||
bool mBlockQuad0;
|
||||
bool mFirstTime;
|
||||
bool mNotifyResolution;
|
||||
bool mOfflineLocalhost;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue