Skip to content

Commit cfe8c46

Browse files
authored
Merge pull request #1625 from baranowb/UNDERTOW-2046_2.2.x
[UNDERTOW-2046] X-Forwarded-For is IP header, not hostname
2 parents 535cc97 + 3f7cb41 commit cfe8c46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/io/undertow/server/handlers/proxy/ProxyHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ public void run() {
479479
final String remoteHost;
480480
final SocketAddress address = exchange.getSourceAddress();
481481
if (address != null) {
482-
remoteHost = ((InetSocketAddress) address).getHostString();
482+
remoteHost = ((InetSocketAddress) address).getAddress().getHostAddress();
483483
if(!((InetSocketAddress) address).isUnresolved()) {
484484
request.putAttachment(ProxiedRequestAttachments.REMOTE_ADDRESS, ((InetSocketAddress) address).getAddress().getHostAddress());
485485
}

0 commit comments

Comments
 (0)