Skip to content

Commit

Permalink
Bug 1722895 - Add new Telemetry for https-only/ first for LABELS_HTTP…
Browse files Browse the repository at this point in the history
…_SCHEME_UPGRADE_TYPE r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D167945
  • Loading branch information
moztomer committed Mar 24, 2023
1 parent c0356c2 commit 602b830
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 10 additions & 3 deletions netwerk/base/nsNetUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2937,9 +2937,16 @@ static bool ShouldSecureUpgradeNoHSTS(nsIURI* aURI, nsILoadInfo* aLoadInfo) {
return true;
}

// 4. Https-Only / -First
if (nsHTTPSOnlyUtils::ShouldUpgradeRequest(aURI, aLoadInfo) ||
nsHTTPSOnlyUtils::ShouldUpgradeHttpsFirstRequest(aURI, aLoadInfo)) {
// 4. Https-Only
if (nsHTTPSOnlyUtils::ShouldUpgradeRequest(aURI, aLoadInfo)) {
Telemetry::AccumulateCategorical(
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::HTTPSOnly);
return true;
}
// 4.a Https-First
if (nsHTTPSOnlyUtils::ShouldUpgradeHttpsFirstRequest(aURI, aLoadInfo)) {
Telemetry::AccumulateCategorical(
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::HTTPSFirst);
return true;
}
return false;
Expand Down
6 changes: 3 additions & 3 deletions toolkit/components/telemetry/Histograms.json
Original file line number Diff line number Diff line change
Expand Up @@ -2800,12 +2800,12 @@
"HTTP_SCHEME_UPGRADE_TYPE": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec"],
"alert_emails": ["[email protected]", "jkt@mozilla.com"],
"bug_numbers": [1340021, 1435733],
"alert_emails": ["[email protected]", "freddyb@mozilla.com"],
"bug_numbers": [1340021, 1435733, 1722895],
"releaseChannelCollection": "opt-out",
"expires_in_version": "never",
"kind": "categorical",
"labels": ["AlreadyHTTPS", "NoReasonToUpgrade", "PrefBlockedSTS", "STS", "CSP", "BrowserDisplay"],
"labels": ["AlreadyHTTPS", "NoReasonToUpgrade", "PrefBlockedSTS", "STS", "CSP", "BrowserDisplay", "HTTPSOnly", "HTTPSFirst"],
"description": "Was the URL upgraded to HTTPS?"
},
"HTTP_RESPONSE_STATUS_CODE": {
Expand Down

0 comments on commit 602b830

Please sign in to comment.