This is an automated email from the ASF dual-hosted git repository. penghui pushed a commit to branch branch-2.10 in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 98849cd52434f9141ca58e730bb6b285635b80bc Author: Lari Hotari <[email protected]> AuthorDate: Wed Apr 20 06:08:36 2022 +0300 Skip unnecessary DNS resolution when creating AuthenticationDataHttp instance (#15221) (cherry picked from commit 14991c93533927c35dd3cba74fe52ba3d57f244b) --- .../apache/pulsar/broker/authentication/AuthenticationDataHttp.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataHttp.java b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataHttp.java index 9d8ab42b467..75a75225576 100644 --- a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataHttp.java +++ b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataHttp.java @@ -18,6 +18,7 @@ */ package org.apache.pulsar.broker.authentication; +import io.netty.util.NetUtil; import java.net.InetSocketAddress; import java.net.SocketAddress; import javax.servlet.http.HttpServletRequest; @@ -34,7 +35,9 @@ public class AuthenticationDataHttp implements AuthenticationDataSource { throw new IllegalArgumentException(); } this.request = request; - this.remoteAddress = new InetSocketAddress(request.getRemoteAddr(), request.getRemotePort()); + this.remoteAddress = + new InetSocketAddress(NetUtil.createInetAddressFromIpAddressString(request.getRemoteAddr()), + request.getRemotePort()); } /*
