Skip to content

Commit

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

(cherry picked from commit 14991c9)
  • Loading branch information
lhotari authored and codelipenghui committed Apr 28, 2022
1 parent c8858e1 commit e690b4c
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 e690b4c

Please sign in to comment.