1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +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, '');
return;
}
return browser.dns.resolve(hn, [ 'canonical_name' ]).then(rec => {
const cname = this.recordCanonicalName(hn, rec);
if ( cname === '' ) { return; }
return this.processCanonicalName(cname, details);
}).catch(( ) => {
this.cnames.set(hn, '');
}).then(( ) => {
});
return browser.dns.resolve(hn, [ 'canonical_name' ]).then(
rec => {
const cname = this.recordCanonicalName(hn, rec);
if ( cname === '' ) { return; }
return this.processCanonicalName(cname, details);
},
( ) => {
this.cnames.set(hn, '');
}
);
}
suspendOneRequest(details) {
const pending = {