Skip to content

Commit

Permalink
fix(deps): update dependency org.apache.httpcomponents.client5:httpcl…
Browse files Browse the repository at this point in the history
…ient5 to v5.4.2

remove workaround that is no longer needed
  • Loading branch information
Athou committed Feb 2, 2025
1 parent 8f42135 commit c451eee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion commafeed-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.4.1</version>
<version>5.4.2</version>
</dependency>
<!-- add brotli support for httpclient5 -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import java.io.IOException;
import java.io.InputStream;
import java.net.IDN;
import java.net.InetAddress;
import java.net.URI;
import java.net.UnknownHostException;
import java.time.Duration;
import java.time.Instant;
import java.time.InstantSource;
Expand All @@ -16,8 +13,6 @@
import java.util.concurrent.ExecutionException;

import org.apache.commons.lang3.StringUtils;
import org.apache.hc.client5.http.DnsResolver;
import org.apache.hc.client5.http.SystemDefaultDnsResolver;
import org.apache.hc.client5.http.config.ConnectionConfig;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.config.TlsConfig;
Expand Down Expand Up @@ -249,7 +244,6 @@ private static PoolingHttpClientConnectionManager newConnectionManager(CommaFeed
.setDefaultTlsConfig(TlsConfig.custom().setHandshakeTimeout(Timeout.of(config.httpClient().sslHandshakeTimeout())).build())
.setMaxConnPerRoute(poolSize)
.setMaxConnTotal(poolSize)
.setDnsResolver(new InternationalizedDomainNameToAsciiDnsResolver(SystemDefaultDnsResolver.INSTANCE))
.build();

}
Expand Down Expand Up @@ -286,18 +280,6 @@ private static Cache<HttpRequest, HttpResponse> newCache(CommaFeedConfiguration
.build();
}

private record InternationalizedDomainNameToAsciiDnsResolver(DnsResolver delegate) implements DnsResolver {
@Override
public InetAddress[] resolve(String host) throws UnknownHostException {
return delegate.resolve(IDN.toASCII(host));
}

@Override
public String resolveCanonicalHostname(String host) throws UnknownHostException {
return delegate.resolveCanonicalHostname(IDN.toASCII(host));
}
}

@Getter
public static class NotModifiedException extends Exception {
private static final long serialVersionUID = 1L;
Expand Down

0 comments on commit c451eee

Please sign in to comment.