From e34f0085bd8771cb86f6381c5271df9ac8d09af7 Mon Sep 17 00:00:00 2001 From: Nihanth Subramanya Date: Tue, 30 Nov 2021 22:02:14 +0000 Subject: [PATCH] Bug 1737198 - Part 6: Enable strict fallback mode by default in Nightly. r=necko-reviewers,valentin Differential Revision: https://phabricator.services.mozilla.com/D132112 --- modules/libpref/init/StaticPrefList.yaml | 2 +- netwerk/test/unit/head_trr.js | 4 ++++ netwerk/test/unit/trr_common.js | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index cc03e0de0f93..a169bbb6c731 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -9833,7 +9833,7 @@ # If true, don't fallback to native DNS upon network errors. - name: network.trr.strict_native_fallback type: RelaxedAtomicBool - value: false + value: @IS_NIGHTLY_BUILD@ mirror: always # Single TRR request timeout, in milliseconds diff --git a/netwerk/test/unit/head_trr.js b/netwerk/test/unit/head_trr.js index 17f90e7399bc..823c77062478 100644 --- a/netwerk/test/unit/head_trr.js +++ b/netwerk/test/unit/head_trr.js @@ -57,6 +57,9 @@ function trr_test_setup() { ); addCertFromFile(certdb, "http2-ca.pem", "CTu,u,u"); + // Turn off strict fallback mode for most tests, it is tested specifically. + Services.prefs.setBoolPref("network.trr.strict_native_fallback", false); + // We intentionally don't set the TRR mode. Each test should set it // after setup in the first test. @@ -91,6 +94,7 @@ function trr_clear_prefs() { Services.prefs.clearUserPref( "network.trr.send_empty_accept-encoding_headers" ); + Services.prefs.clearUserPref("network.trr.strict_native_fallback"); } /// This class sends a DNS query and can be awaited as a promise to get the diff --git a/netwerk/test/unit/trr_common.js b/netwerk/test/unit/trr_common.js index 74bbd7e76079..b65576e957a2 100644 --- a/netwerk/test/unit/trr_common.js +++ b/netwerk/test/unit/trr_common.js @@ -348,7 +348,7 @@ async function test_strict_native_fallback() { setModeAndURI(2, "doh?responseIP=2.2.2.2&corruptedAnswer=true"); await new TRRDNSListener("bar.example.com", "127.0.0.1"); // Should fallback - Services.prefs.clearUserPref("network.trr.strict_native_fallback"); + Services.prefs.setBoolPref("network.trr.strict_native_fallback", false); Services.prefs.clearUserPref("network.trr.request_timeout_ms"); Services.prefs.clearUserPref("network.trr.request_timeout_mode_trronly_ms"); }