mirror of https://github.com/gorhill/uBlock.git
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, '');
|
||||
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 = {
|
||||
|
|
Loading…
Reference in New Issue