Check for wildcard when determining if proxy should be bypassed (#497)

The `shouldBypassProxy` method from `ProxyUtils.swift` did not account
for `NO_PROXY` entries of the form `*.host.com`
This PR adds an additional check to determine if the proxy should be
bypassed for a given host.
This commit is contained in:
Aditya Ramani authored and GitHub committed 2026-01-28 09:55:45 -08:00
1 parent db113ffec9
commit 3a0b79d7fb
2 files changed
+14

No files matched your search

@@ -66,6 +66,10 @@ public enum ProxyUtils {
if entry.isEmpty { continue }
if entry == "*" { return true }
if host == entry { return true }
if entry.hasPrefix("*.") {
let suffix = String(entry.dropFirst())
if host.hasSuffix(suffix) { return true }
}
if entry.hasPrefix(".") && host.hasSuffix(entry) { return true }
}
return false