зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1619071 - Trip Canary heuristic when canonical lookup contains only local addresses. r=necko-reviewers,valentin
This allows certain routers to signal us to disable DoH when they are not capable of responding with NXDOMAIN or no A records. Differential Revision: https://phabricator.services.mozilla.com/D127538
This commit is contained in:
Родитель
2a647010dd
Коммит
f56119bc09
|
@ -186,7 +186,13 @@ async function dnsListLookup(domainList) {
|
|||
async function globalCanary() {
|
||||
let { addresses, err } = await dnsLookup(GLOBAL_CANARY);
|
||||
|
||||
if (err === NXDOMAIN_ERR || !addresses.length) {
|
||||
if (
|
||||
err === NXDOMAIN_ERR ||
|
||||
!addresses.length ||
|
||||
addresses.every(addr =>
|
||||
Services.io.hostnameIsLocalIPAddress(Services.io.newURI(`http://${addr}`))
|
||||
)
|
||||
) {
|
||||
return "disable_doh";
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче