roryqi commented on code in PR #11191:
URL: https://github.com/apache/gravitino/pull/11191#discussion_r3281311990
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/listener/api/event/IcebergRequestContext.java:
##########
@@ -58,13 +58,21 @@ public IcebergRequestContext(HttpServletRequest
httpRequest, String catalogName)
public IcebergRequestContext(
HttpServletRequest httpRequest, String catalogName, boolean
requestCredentialVending) {
this.httpServletRequest = httpRequest;
- this.remoteHostName = httpRequest.getRemoteHost();
+ this.remoteHostName = resolveClientAddress(httpRequest);
this.httpHeaders = IcebergRESTUtils.getHttpHeaders(httpRequest);
this.catalogName = catalogName;
this.userName = PrincipalUtils.getCurrentUserName();
this.requestCredentialVending = requestCredentialVending;
}
+ private static String resolveClientAddress(HttpServletRequest request) {
+ String xff = request.getHeader("X-Forwarded-For");
+ if (xff != null && !xff.isEmpty()) {
Review Comment:
StringUtils.isNotBlank? What's meaning of `xff`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]