Skip to content

Commit

Permalink
BSR
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Nov 30, 2023
1 parent 16c5750 commit 6d53509
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions manage-server/src/main/java/manage/web/HttpHostProvider.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package manage.web;

import lombok.SneakyThrows;
import org.apache.http.HttpHost;
import org.springframework.util.StringUtils;

Expand All @@ -15,7 +14,6 @@ public class HttpHostProvider {
private HttpHostProvider() {
}

@SneakyThrows
public static Optional<HttpHost> resolveHttpHost(URL url) {
String proxyHost = System.getProperty("http.proxyHost");
String nonProxyHosts = System.getProperty("http.nonProxyHosts");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ class HttpHostProviderTest {
void resolveHttpHost() {
System.setProperty("http.proxyHost", "proxy.com");
System.setProperty("http.nonProxyHosts", "*.example.com|localhost|*domain.org|*broadband*");
boolean ignoreProxy = List.of(
boolean ignoreProxy = Stream.of(
"https://www.example.com",
"https://www.sub.example.com",
"http://localhost:8080",
"https://sub.domain.org",
"https://www.broadband.com")
.stream()
.map(url -> HttpHostProvider.resolveHttpHost(url(url)))
.noneMatch(Optional::isPresent);
assertTrue(ignoreProxy);
Expand Down

0 comments on commit 6d53509

Please sign in to comment.