1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +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(
const cname = this.recordCanonicalName(hn, rec); rec => {
if ( cname === '' ) { return; } const cname = this.recordCanonicalName(hn, rec);
return this.processCanonicalName(cname, details); if ( cname === '' ) { return; }
}).catch(( ) => { return this.processCanonicalName(cname, details);
this.cnames.set(hn, ''); },
}).then(( ) => { ( ) => {
}); this.cnames.set(hn, '');
}
);
} }
suspendOneRequest(details) { suspendOneRequest(details) {
const pending = { const pending = {