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:
parent
30ac8a1fa5
commit
3463a60e6b
@ -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 = {
|
||||||
|
Loading…
Reference in New Issue
Block a user