diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /netwerk/dns/nsDNSService2.cpp | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/dns/nsDNSService2.cpp')
-rw-r--r-- | netwerk/dns/nsDNSService2.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/netwerk/dns/nsDNSService2.cpp b/netwerk/dns/nsDNSService2.cpp index 68a76a0c1f..b688daadc9 100644 --- a/netwerk/dns/nsDNSService2.cpp +++ b/netwerk/dns/nsDNSService2.cpp @@ -874,7 +874,7 @@ nsDNSService::Init() { do_GetService("@mozilla.org/network/oblivious-http-service;1")); mTrrService = new TRRService(); - if (NS_FAILED(mTrrService->Init())) { + if (NS_FAILED(mTrrService->Init(mResolver->IsNativeHTTPSEnabled()))) { mTrrService = nullptr; } @@ -975,6 +975,15 @@ nsresult nsDNSService::PreprocessHostname(bool aLocalDomain, return NS_OK; } +bool nsDNSService::IsLocalDomain(const nsACString& aHostname) const { + bool localDomain = mLocalDomains.Contains(aHostname); + if (StringEndsWith(aHostname, "."_ns)) { + localDomain = localDomain || mLocalDomains.Contains(Substring( + aHostname, 0, aHostname.Length() - 1)); + } + return localDomain; +} + nsresult nsDNSService::AsyncResolveInternal( const nsACString& aHostname, uint16_t type, nsIDNSService::DNSFlags flags, nsIDNSAdditionalInfo* aInfo, nsIDNSListener* aListener, @@ -996,7 +1005,8 @@ nsresult nsDNSService::AsyncResolveInternal( res = mResolver; idn = mIDN; - localDomain = mLocalDomains.Contains(aHostname); + + localDomain = IsLocalDomain(aHostname); } if (mNotifyResolution) { @@ -1076,7 +1086,7 @@ nsresult nsDNSService::CancelAsyncResolveInternal( res = mResolver; idn = mIDN; - localDomain = mLocalDomains.Contains(aHostname); + localDomain = IsLocalDomain(aHostname); } if (!res) { return NS_ERROR_OFFLINE; @@ -1212,7 +1222,7 @@ nsresult nsDNSService::ResolveInternal( MutexAutoLock lock(mLock); res = mResolver; idn = mIDN; - localDomain = mLocalDomains.Contains(aHostname); + localDomain = IsLocalDomain(aHostname); } if (mNotifyResolution) { |