Skip to content

Commit a525f2d

Browse files
committed
Fix detection of proxy settings
1 parent 440fba1 commit a525f2d

File tree

1 file changed

+8
-5
lines changed
  • core/esmf-aspect-model-github-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/github

1 file changed

+8
-5
lines changed

core/esmf-aspect-model-github-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/github/GitHubModelSource.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ private static Config detectProxySettings() {
107107
}
108108
}
109109

110-
return GitHubModelSourceConfigBuilder.builder()
111-
.proxy( ProxySelector.of(
112-
new InetSocketAddress( System.getProperty( "http.proxyHost" ),
113-
Integer.parseInt( System.getProperty( "http.proxyPort" ) ) ) ) )
114-
.build();
110+
final String host = System.getProperty( "http.proxyHost" );
111+
final String port = System.getProperty( "http.proxyPort" );
112+
if ( host != null && port != null ) {
113+
return GitHubModelSourceConfigBuilder.builder()
114+
.proxy( ProxySelector.of( new InetSocketAddress( host, Integer.parseInt( port ) ) ) )
115+
.build();
116+
}
117+
return GitHubModelSourceConfigBuilder.builder().build();
115118
}
116119

117120
@RecordBuilder

0 commit comments

Comments
 (0)