ProxyUtils: correctly handle the 'no proxy' case (#1148)

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya
2020-10-11 19:16:48 +05:30
committed by GitHub
parent facc4d9163
commit 591bb4e795

View File

@@ -32,7 +32,7 @@ object ProxyUtils {
val host = GitSettings.proxyHost val host = GitSettings.proxyHost
val port = GitSettings.proxyPort val port = GitSettings.proxyPort
return if (host == null || port == -1) { return if (host == null || port == -1) {
mutableListOf() mutableListOf(Proxy.NO_PROXY)
} else { } else {
mutableListOf(Proxy(Proxy.Type.HTTP, InetSocketAddress.createUnresolved(host, port))) mutableListOf(Proxy(Proxy.Type.HTTP, InetSocketAddress.createUnresolved(host, port)))
} }