diff --git a/netwerk/dns/TRR.cpp b/netwerk/dns/TRR.cpp index 62211b0e9a38..d3d9364a0cd5 100644 --- a/netwerk/dns/TRR.cpp +++ b/netwerk/dns/TRR.cpp @@ -150,6 +150,7 @@ nsresult TRR::CreateQueryURI(nsIURI** aOutURI) { nsresult rv = NS_NewURI(getter_AddRefs(dnsURI), uri); if (NS_FAILED(rv)) { + RecordReason(TRRSkippedReason::TRR_BAD_URL); return rv; } diff --git a/netwerk/dns/nsDNSService2.cpp b/netwerk/dns/nsDNSService2.cpp index 632e02a6e237..7ff03ba7f7cb 100644 --- a/netwerk/dns/nsDNSService2.cpp +++ b/netwerk/dns/nsDNSService2.cpp @@ -1632,6 +1632,7 @@ nsresult GetTRRSkipReasonName(TRRSkippedReason aReason, nsACString& aName) { static_assert(TRRSkippedReason::TRR_HEURISTIC_TRIPPED_VPN == 45); static_assert(TRRSkippedReason::TRR_HEURISTIC_TRIPPED_PROXY == 46); static_assert(TRRSkippedReason::TRR_HEURISTIC_TRIPPED_NRPT == 47); + static_assert(TRRSkippedReason::TRR_BAD_URL == 48); switch (aReason) { case TRRSkippedReason::TRR_UNSET: @@ -1778,6 +1779,9 @@ nsresult GetTRRSkipReasonName(TRRSkippedReason aReason, nsACString& aName) { case TRRSkippedReason::TRR_HEURISTIC_TRIPPED_NRPT: aName = "TRR_HEURISTIC_TRIPPED_NRPT"_ns; break; + case TRRSkippedReason::TRR_BAD_URL: + aName = "TRR_BAD_URL"_ns; + break; default: MOZ_ASSERT(false, "Unknown value"); } diff --git a/netwerk/dns/nsITRRSkipReason.idl b/netwerk/dns/nsITRRSkipReason.idl index dedca0231606..096f0151bbeb 100644 --- a/netwerk/dns/nsITRRSkipReason.idl +++ b/netwerk/dns/nsITRRSkipReason.idl @@ -60,6 +60,7 @@ interface nsITRRSkipReason: nsISupports TRR_HEURISTIC_TRIPPED_VPN = 45, // The heuristic was tripped due to a vpn being detected TRR_HEURISTIC_TRIPPED_PROXY = 46, // The heuristic was tripped due to a proxy being detected TRR_HEURISTIC_TRIPPED_NRPT = 47, // The heuristic was tripped due to a NRPT being detected + TRR_BAD_URL = 48, // We attempted to use a bad URL (doesn't parse or is not https). }; }; diff --git a/toolkit/content/aboutNetError.mjs b/toolkit/content/aboutNetError.mjs index 2ac54d7aa5c6..1c92a2927409 100644 --- a/toolkit/content/aboutNetError.mjs +++ b/toolkit/content/aboutNetError.mjs @@ -544,6 +544,8 @@ function initPage() { skipReason == "TRR_SERVER_RESPONSE_ERR" ) { descriptionTag = "neterror-dns-not-found-trr-server-problem"; + } else if (skipReason == "TRR_BAD_URL") { + descriptionTag = "neterror-dns-not-found-bad-trr-url"; } let trrMode = RPMGetIntPref("network.trr.mode").toString(); diff --git a/toolkit/locales/en-US/toolkit/neterror/netError.ftl b/toolkit/locales/en-US/toolkit/neterror/netError.ftl index de3fa65b88b7..6ecfa143e463 100644 --- a/toolkit/locales/en-US/toolkit/neterror/netError.ftl +++ b/toolkit/locales/en-US/toolkit/neterror/netError.ftl @@ -65,6 +65,7 @@ neterror-dns-not-found-trr-only-timeout = The connection to { $trrDomain } took neterror-dns-not-found-trr-offline = You are not connected to the internet. neterror-dns-not-found-trr-unknown-host2 = This website wasn’t found by { $trrDomain }. neterror-dns-not-found-trr-server-problem = There was a problem with { $trrDomain }. +neterror-dns-not-found-bad-trr-url = Invalid URL. neterror-dns-not-found-trr-unknown-problem = Unexpected problem. ## Native fallback specific messages