summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2019-10-30 19:20:30 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2019-10-30 19:20:30 -0400
commitb29e9bd1cb252577c1b8118861830cffcf15fd27 (patch)
tree092decdc663d1915d170f96f2020c4b0ef5c378e /org.eclipse.jgit
parent7c75a68b9635848a8231df8a1461c3f9405a55f4 (diff)
parentb7d1eb4185aa35f037790580b60c1f2d76968fa8 (diff)
downloadjgit-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.java5
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));