mirror of
https://github.com/google/nomulus
synced 2026-02-07 13:31:12 +00:00
Make FOSS proxy treat connections with unknown sources more gracefully
When a connection to the proxy using the PROXY protocol (https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) comes from an IP address that the external load balancer does not recognize, make the source IP 0.0.0.0. This way an appropriate WHOIS quota can be configured for this kind of connections. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=224583547
This commit is contained in:
@@ -57,7 +57,7 @@ public class ProxyProtocolHandlerTest {
|
||||
assertThat(channel.writeInbound(Unpooled.wrappedBuffer((header + message).getBytes(UTF_8))))
|
||||
.isTrue();
|
||||
assertThat(((ByteBuf) channel.readInbound()).toString(UTF_8)).isEqualTo(message);
|
||||
assertThat(channel.attr(REMOTE_ADDRESS_KEY).get()).isNull();
|
||||
assertThat(channel.attr(REMOTE_ADDRESS_KEY).get()).isEqualTo("0.0.0.0");
|
||||
assertThat(channel.pipeline().get(ProxyProtocolHandler.class)).isNull();
|
||||
assertThat(channel.isActive()).isTrue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user