1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00

Fix incorrect resolved value in promise

This fixes the ability to block when a hostname
had to be cname-resolved the first time it was
encountered. The result being cached allowed
the subsequent requests to be correctly blockable.
This commit is contained in:
Raymond Hill 2019-11-21 12:04:19 -05:00
parent 30ac8a1fa5
commit 3463a60e6b
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -197,14 +197,16 @@
this.cnames.set(hn, ''); this.cnames.set(hn, '');
return; return;
} }
return browser.dns.resolve(hn, [ 'canonical_name' ]).then(rec => { return browser.dns.resolve(hn, [ 'canonical_name' ]).then(
rec => {
const cname = this.recordCanonicalName(hn, rec); const cname = this.recordCanonicalName(hn, rec);
if ( cname === '' ) { return; } if ( cname === '' ) { return; }
return this.processCanonicalName(cname, details); return this.processCanonicalName(cname, details);
}).catch(( ) => { },
( ) => {
this.cnames.set(hn, ''); this.cnames.set(hn, '');
}).then(( ) => { }
}); );
} }
suspendOneRequest(details) { suspendOneRequest(details) {
const pending = { const pending = {