diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2019-10-30 19:20:30 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2019-10-30 19:20:30 -0400 |
commit | b29e9bd1cb252577c1b8118861830cffcf15fd27 (patch) | |
tree | 092decdc663d1915d170f96f2020c4b0ef5c378e /org.eclipse.jgit | |
parent | 7c75a68b9635848a8231df8a1461c3f9405a55f4 (diff) | |
parent | b7d1eb4185aa35f037790580b60c1f2d76968fa8 (diff) | |
download | jgit-b29e9bd1cb252577c1b8118861830cffcf15fd27.tar.gz jgit-b29e9bd1cb252577c1b8118861830cffcf15fd27.zip |
Merge "HttpSupport.proxyFor(): use only scheme, host, and port"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java index 640670debc..d897255062 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java @@ -51,6 +51,7 @@ import java.io.UnsupportedEncodingException; import java.net.ConnectException; import java.net.Proxy; import java.net.ProxySelector; +import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.URLEncoder; @@ -299,7 +300,9 @@ public class HttpSupport { public static Proxy proxyFor(ProxySelector proxySelector, URL u) throws ConnectException { try { - return proxySelector.select(u.toURI()).get(0); + URI uri = new URI(u.getProtocol(), null, u.getHost(), u.getPort(), + null, null, null); + return proxySelector.select(uri).get(0); } catch (URISyntaxException e) { final ConnectException err; err = new ConnectException(MessageFormat.format(JGitText.get().cannotDetermineProxyFor, u)); |