Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,8 @@ private String launchCommandWithCredentials(ArgumentListBuilder args, File workD

if ("http".equalsIgnoreCase(url.getScheme()) || "https".equalsIgnoreCase(url.getScheme())) {
if (proxy != null) {
List<String>listOfConfiguredNoProxyHosts = new ArrayList<String>();
listOfConfiguredNoProxyHosts.add("169.254.169.254");
boolean shouldProxy = true;
for(Pattern p : proxy.getNoProxyHostPatterns()) {
if(p.matcher(url.getHost()).matches()) {
Expand All @@ -2034,6 +2036,7 @@ private String launchCommandWithCredentials(ArgumentListBuilder args, File workD
URI http_proxy = new URI("http", userInfo, proxy.name, proxy.port, null, null, null);
env.put("http_proxy", http_proxy.toString());
env.put("https_proxy", http_proxy.toString());
env.put("NO_PROXY", String.join(", ",listOfConfiguredNoProxyHosts));
} catch (URISyntaxException ex) {
throw new GitException("Failed to create http proxy uri", ex);
}
Expand Down