Skip to content

Commit 4305bfb

Browse files
committed
1 parent 73ce4e6 commit 4305bfb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

platform/firefox/vapi-background-ext.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ const isPromise = o => o instanceof Promise;
3636
const isResolvedObject = o => o instanceof Object &&
3737
o instanceof Promise === false;
3838
const reIPv4 = /^\d+\.\d+\.\d+\.\d+$/
39+
const skipDNS = proxyInfo =>
40+
proxyInfo?.proxyDNS || proxyInfo?.type?.startsWith('http');
3941

4042
/******************************************************************************/
4143

@@ -102,7 +104,7 @@ vAPI.Net = class extends vAPI.Net {
102104

103105
normalizeDetails(details) {
104106
// https://github.com/uBlockOrigin/uBlock-issues/issues/3379
105-
if ( details.proxyInfo?.proxyDNS && details.ip === '0.0.0.0' ) {
107+
if ( skipDNS(details.proxyInfo) && details.ip === '0.0.0.0' ) {
106108
details.ip = null;
107109
}
108110
const type = details.type;
@@ -182,8 +184,8 @@ vAPI.Net = class extends vAPI.Net {
182184
if ( isResolvedObject(dnsEntry) ) {
183185
return this.onAfterDNSResolution(hn, details, dnsEntry);
184186
}
187+
if ( skipDNS(details.proxyInfo) ) { return; }
185188
if ( this.dnsShouldResolve(hn) === false ) { return; }
186-
if ( details.proxyInfo?.proxyDNS ) { return; }
187189
const promise = dnsEntry || this.dnsResolve(hn, details);
188190
return promise.then(( ) => this.onAfterDNSResolution(hn, details));
189191
}

0 commit comments

Comments
 (0)