From 1fcc11f6b441a2ea68bbce2f76071d15404e053d Mon Sep 17 00:00:00 2001 From: Simon Stewart Date: Fri, 18 Aug 2017 10:38:15 +0100 Subject: [PATCH] Update deprecated calls to `HostAndPort.getHostText()` The `getHostText` method is deprecated, and scheduled for deletion. Although LittleProxy continues to support Java 7, using this deprecated method causes it to fail when used to Guava 23 (the latest release) Fortunately, `getHost` returns exactly the same value and is present in the latest releases. --- .../org/littleshoot/proxy/impl/ProxyToServerConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java b/src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java index 2c9cece42..b612f5160 100644 --- a/src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java +++ b/src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java @@ -572,7 +572,7 @@ private void initializeConnectionFlow() { .serverSslEngine())); } else { connectionFlow.then(serverConnection.EncryptChannel(proxyServer.getMitmManager() - .serverSslEngine(parsedHostAndPort.getHostText(), parsedHostAndPort.getPort()))); + .serverSslEngine(parsedHostAndPort.getHost(), parsedHostAndPort.getPort()))); } connectionFlow @@ -958,7 +958,7 @@ public static InetSocketAddress addressFor(String hostAndPort, DefaultHttpProxyS throw new UnknownHostException(hostAndPort); } - String host = parsedHostAndPort.getHostText(); + String host = parsedHostAndPort.getHost(); int port = parsedHostAndPort.getPortOrDefault(80); return proxyServer.getServerResolver().resolve(host, port);