Skip to content

Commit

Permalink
Skip unnecessary DNS resolution when creating AuthenticationDataHttp …
Browse files Browse the repository at this point in the history
…instance (apache#15221)

(cherry picked from commit 14991c9)
  • Loading branch information
lhotari committed Apr 21, 2022
1 parent 4fdb34e commit 34c4fb3
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.pulsar.broker.authentication;

import io.netty.util.NetUtil;
import java.net.InetSocketAddress;
import java.net.SocketAddress;

Expand All @@ -35,7 +36,9 @@ public AuthenticationDataHttp(HttpServletRequest request) {
throw new IllegalArgumentException();
}
this.request = request;
this.remoteAddress = new InetSocketAddress(request.getRemoteAddr(), request.getRemotePort());
this.remoteAddress =
new InetSocketAddress(NetUtil.createInetAddressFromIpAddressString(request.getRemoteAddr()),
request.getRemotePort());
}

/*
Expand Down

0 comments on commit 34c4fb3

Please sign in to comment.