Skip to content

Commit

Permalink
Fix nonProxyHost conf.
Browse files Browse the repository at this point in the history
  • Loading branch information
psiotwo committed Sep 21, 2022
1 parent d664dde commit 55eadff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/cz/sio2/obo/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.apache.hc.core5.http.protocol.HttpContext;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;

Expand All @@ -28,7 +29,8 @@ public static HttpClientBuilder createBuilder() {
.custom()
.setDefaultRequestConfig(config);

final List<String> nonProxyHosts = Arrays.asList(System.getProperty("http.nonProxyHosts").split(","));
final String nonProxyHostsString = System.getProperty("http.nonProxyHosts");
final List<String> nonProxyHosts = nonProxyHostsString != null ? Arrays.asList(nonProxyHostsString.split(",")) : Collections.emptyList();
final String proxyHost = System.getProperty("http.proxyHost");
if (proxyHost != null && !proxyHost.isEmpty()) {
final String proxyPort = System.getProperty("http.proxyPort");
Expand Down

0 comments on commit 55eadff

Please sign in to comment.