summaryrefslogtreecommitdiffstats
path: root/netwerk/ipc/DocumentLoadListener.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 04:01:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 04:01:55 +0000
commit0409b8aa646ea5192cd91976a89f71024129344c (patch)
treef95ba411e9e8b81d511c448d9fc010a876e8b481 /netwerk/ipc/DocumentLoadListener.cpp
parentAdding upstream version 127.0. (diff)
downloadfirefox-0409b8aa646ea5192cd91976a89f71024129344c.tar.xz
firefox-0409b8aa646ea5192cd91976a89f71024129344c.zip
Adding upstream version 127.0.1.upstream/127.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/ipc/DocumentLoadListener.cpp')
-rw-r--r--netwerk/ipc/DocumentLoadListener.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp
index a133df4663..280348e449 100644
--- a/netwerk/ipc/DocumentLoadListener.cpp
+++ b/netwerk/ipc/DocumentLoadListener.cpp
@@ -644,6 +644,7 @@ auto DocumentLoadListener::Open(nsDocShellLoadState* aLoadState,
// See description of mFileName in nsDocShellLoadState.h
mIsDownload = !aLoadState->FileName().IsVoid();
mIsLoadingJSURI = net::SchemeIsJavascript(aLoadState->URI());
+ mHTTPSFirstDowngradeData = aLoadState->GetHttpsFirstDowngradeData().forget();
// Check for infinite recursive object or iframe loads
if (aLoadState->OriginalFrameSrc() || !mIsDocumentLoad) {
@@ -2427,9 +2428,7 @@ bool DocumentLoadListener::MaybeHandleLoadErrorWithURIFixup(nsresult aStatus) {
loadState->SetWasSchemelessInput(wasSchemelessInput);
if (isHTTPSFirstFixup) {
- // We have to exempt the load from HTTPS-First to prevent a
- // upgrade-downgrade loop.
- loadState->SetIsExemptFromHTTPSFirstMode(true);
+ nsHTTPSOnlyUtils::UpdateLoadStateAfterHTTPSFirstDowngrade(this, loadState);
}
// Ensure to set referrer information in the fallback channel equally to the
@@ -2571,6 +2570,17 @@ DocumentLoadListener::OnStartRequest(nsIRequest* aRequest) {
return NS_OK;
}
+ // If this is a successful load with a successful status code, we can possibly
+ // submit HTTPS-First telemetry.
+ if (NS_SUCCEEDED(status) && httpChannel) {
+ uint32_t responseStatus = 0;
+ if (NS_SUCCEEDED(httpChannel->GetResponseStatus(&responseStatus)) &&
+ responseStatus < 400) {
+ nsHTTPSOnlyUtils::SubmitHTTPSFirstTelemetry(
+ mChannel->LoadInfo(), mHTTPSFirstDowngradeData.forget());
+ }
+ }
+
mStreamListenerFunctions.AppendElement(StreamListenerFunction{
VariantIndex<0>{}, OnStartRequestParams{aRequest}});