Refine again how proxy settings apply

Only set bypass domains if manual configuration.
This commit is contained in:
Davide De Rosa 2022-04-13 19:53:07 +02:00
parent 0849fe6cc7
commit a3202bb218
2 changed files with 10 additions and 13 deletions

View File

@ -117,23 +117,20 @@ extension OpenVPN.ConfigurationBuilder {
switch settings.configurationType {
case .manual:
if let proxyServer = settings.proxyServer {
httpProxy = proxyServer
httpsProxy = proxyServer
proxyAutoConfigurationURL = nil
}
httpProxy = settings.proxyServer
httpsProxy = settings.proxyServer
proxyBypassDomains = settings.proxyBypassDomains.filter { !$0.isEmpty }
proxyAutoConfigurationURL = nil
case .pac:
if let pac = settings.proxyAutoConfigurationURL {
httpProxy = nil
httpsProxy = nil
proxyAutoConfigurationURL = pac
}
httpProxy = nil
httpsProxy = nil
proxyBypassDomains = nil
proxyAutoConfigurationURL = settings.proxyAutoConfigurationURL
case .disabled:
break
}
proxyBypassDomains = settings.proxyBypassDomains.filter { !$0.isEmpty }
}
}

View File

@ -65,9 +65,9 @@ public protocol DNSSettingsProviding {
public protocol ProxySettingsProviding {
var proxyServer: Proxy? { get }
var proxyAutoConfigurationURL: URL? { get }
var proxyBypassDomains: [String] { get }
var proxyAutoConfigurationURL: URL? { get }
}
public protocol MTUSettingsProviding {