diff --git a/java/google/registry/proxy/handler/ProxyProtocolHandler.java b/java/google/registry/proxy/handler/ProxyProtocolHandler.java index 0a6faada1..0433eb6ef 100644 --- a/java/google/registry/proxy/handler/ProxyProtocolHandler.java +++ b/java/google/registry/proxy/handler/ProxyProtocolHandler.java @@ -81,7 +81,7 @@ public class ProxyProtocolHandler extends ByteToMessageDecoder { remoteIP = headerArray[2]; logger.atFine().log("Header parsed, using %s as remote IP.", remoteIP); } else { - logger.atFine().log("Cannot parse the header, use source IP as a last resort."); + logger.atFine().log("Cannot parse the header, using source IP as a last resort."); remoteIP = getSourceIP(ctx); } } else { diff --git a/javatests/google/registry/proxy/handler/ProxyProtocolHandlerTest.java b/javatests/google/registry/proxy/handler/ProxyProtocolHandlerTest.java index 650398f0c..fa7b8f2bd 100644 --- a/javatests/google/registry/proxy/handler/ProxyProtocolHandlerTest.java +++ b/javatests/google/registry/proxy/handler/ProxyProtocolHandlerTest.java @@ -50,14 +50,13 @@ public class ProxyProtocolHandlerTest { } @Test - public void testSuccess_proxyHeaderMalformed_singleFrame() { + public void testSuccess_proxyHeaderUnknownSource_singleFrame() { header = "PROXY UNKNOWN\r\n"; String message = "some message"; // Header processed, rest of the message passed along. assertThat(channel.writeInbound(Unpooled.wrappedBuffer((header + message).getBytes(UTF_8)))) .isTrue(); assertThat(((ByteBuf) channel.readInbound()).toString(UTF_8)).isEqualTo(message); - // Header malformed. assertThat(channel.attr(REMOTE_ADDRESS_KEY).get()).isNull(); assertThat(channel.pipeline().get(ProxyProtocolHandler.class)).isNull(); assertThat(channel.isActive()).isTrue();