mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1848304 - A bad TRR URL shows unexpected error in TRR mode3 error page r=necko-reviewers,fluent-reviewers,flod,kershaw
This patch adds a new TRR skip reason used when the TRR request is made with an invalid URL. Normally this is a URL that doesn't parse, but if the URL is a non-HTTPS URL, then the TRR service will just use an empty string as the URL, leading to the same failure to parse it. This skip reason will be reported when the page load is triggered. We should report the cause to the user instead of just saying it failed because of an "Unexpected problem". Differential Revision: https://phabricator.services.mozilla.com/D185991
This commit is contained in:
parent
1b238acfd1
commit
c7a231e018
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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).
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user