mirror of
https://github.com/apple/container.git
synced 2026-10-14 10:09:10 +00:00
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:
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
|
||||
|
||||
Reference in new issue
Block a user