10000 Merge pull request #109 from schulzh/master · github-cloud/github-plugin@c43344a · GitHub
[go: up one dir, main page]

Skip to content

Commit c43344a

Browse files
committed
Merge pull request jenkinsci#109 from schulzh/master
Fixed incorrect proxy configuration of GitHubLoginFunction
2 parents 5664ab1 + 24759ab commit c43344a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/org/jenkinsci/plugins/github/internal/GitHubLoginFunction.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import javax.annotation.Nonnull;
2121
import java.io.IOException;
2222
import java.net.HttpURLConnection;
23+
import java.net.MalformedURLException;
2324
import java.net.Proxy;
2425
import java.net.URL;
2526

@@ -90,7 +91,11 @@ private Proxy getProxy(String apiUrl) {
9091
if (jenkins.proxy == null) {
9192
return Proxy.NO_PROXY;
9293
} else {
93-
return jenkins.proxy.createProxy(apiUrl);
94+
try {
95+
return jenkins.proxy.createProxy(new URL(apiUrl).getHost());
96+
} catch (MalformedURLException e) {
97+
return jenkins.proxy.createProxy(apiUrl);
98+
}
9499
}
95100
}
96101

0 commit comments

Comments
 (0)
0