summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol/http/nsHttpHandler.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /netwerk/protocol/http/nsHttpHandler.cpp
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-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/protocol/http/nsHttpHandler.cpp')
-rw-r--r--netwerk/protocol/http/nsHttpHandler.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
index b6440c88b5..d0aebdf965 100644
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -2204,12 +2204,8 @@ nsresult nsHttpHandler::SpeculativeConnectInternal(
originAttributes = std::move(aOriginAttributes.ref());
} else if (aPrincipal) {
originAttributes = aPrincipal->OriginAttributesRef();
- StoragePrincipalHelper::UpdateOriginAttributesForNetworkState(
- aURI, originAttributes);
} else if (loadContext) {
loadContext->GetOriginAttributes(originAttributes);
- StoragePrincipalHelper::UpdateOriginAttributesForNetworkState(
- aURI, originAttributes);
}
nsCOMPtr<nsIURI> clone;
@@ -2222,6 +2218,15 @@ nsresult nsHttpHandler::SpeculativeConnectInternal(
}
}
+ if (!aOriginAttributes) {
+ // We must update the originAttributes with the network state first party
+ // domain **after** we upgrade aURI to https.
+ // Otherwise the speculative connection will be keyed by a http URL
+ // and end up not being used.
+ StoragePrincipalHelper::UpdateOriginAttributesForNetworkState(
+ aURI, originAttributes);
+ }
+
nsAutoCString scheme;
nsresult rv = aURI->GetScheme(scheme);
if (NS_FAILED(rv)) return rv;
@@ -2748,12 +2753,15 @@ bool nsHttpHandler::UseHTTPSRRAsAltSvcEnabled() const {
}
bool nsHttpHandler::EchConfigEnabled(bool aIsHttp3) const {
+ if (mParentalControlEnabled) {
+ return false;
+ }
+
if (!aIsHttp3) {
return StaticPrefs::network_dns_echconfig_enabled();
}
- return StaticPrefs::network_dns_echconfig_enabled() &&
- StaticPrefs::network_dns_http3_echconfig_enabled();
+ return StaticPrefs::network_dns_http3_echconfig_enabled();
}
bool nsHttpHandler::FallbackToOriginIfConfigsAreECHAndAllFailed() const {