Skip to content

Commit 85bb815

Browse files
author
Stephane Landelle
committed
Drop Proxy.getURI, close AsyncHttpClient#586
1 parent de6030e commit 85bb815

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

api/src/main/java/org/asynchttpclient/DefaultConnectionPoolStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public enum DefaultConnectionPoolStrategy implements ConnectionPoolKeyStrategy {
2626
@Override
2727
public String getKey(URI uri, ProxyServer proxyServer) {
2828
String serverPart = AsyncHttpProviderUtils.getBaseUrl(uri);
29-
return proxyServer != null ? AsyncHttpProviderUtils.getBaseUrl(proxyServer.getURI()) + serverPart : serverPart;
29+
return proxyServer != null ? proxyServer.getUrl() + serverPart : serverPart;
3030
}
3131
}

api/src/main/java/org/asynchttpclient/ProxyServer.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
*/
1717
package org.asynchttpclient;
1818

19-
import org.asynchttpclient.util.AsyncHttpProviderUtils;
2019
import org.asynchttpclient.util.StandardCharsets;
2120

22-
import java.net.URI;
2321
import java.nio.charset.Charset;
2422
import java.util.ArrayList;
2523
import java.util.Collections;
@@ -55,7 +53,7 @@ public String toString() {
5553
private final String principal;
5654
private final String password;
5755
private final int port;
58-
private final URI uri;
56+
private final String url;
5957
private String encoding = StandardCharsets.UTF_8.name();
6058
private Charset charset = StandardCharsets.UTF_8;
6159
private String ntlmDomain = System.getProperty("http.auth.ntlm.domain", "");
@@ -66,7 +64,7 @@ public ProxyServer(final Protocol protocol, final String host, final int port, S
6664
this.port = port;
6765
this.principal = principal;
6866
this.password = password;
69-
this.uri = AsyncHttpProviderUtils.createNonEmptyPathURI(toString());
67+
url = protocol + "://" + host + ":" + port;
7068
}
7169

7270
public ProxyServer(final String host, final int port, String principal, String password) {
@@ -119,8 +117,8 @@ public Charset getCharset() {
119117
return charset;
120118
}
121119

122-
public URI getURI() {
123-
return uri;
120+
public String getUrl() {
121+
return url;
124122
}
125123

126124
public ProxyServer addNonProxyHost(String uri) {
@@ -148,6 +146,6 @@ public String getNtlmDomain() {
148146

149147
@Override
150148
public String toString() {
151-
return protocol + "://" + host + ":" + port;
149+
return url;
152150
}
153151
}

0 commit comments

Comments
 (0)