FANNG1 commented on code in PR #5495:
URL: https://github.com/apache/gravitino/pull/5495#discussion_r1831974805
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/IcebergRestUtils.java:
##########
@@ -122,6 +126,19 @@ public static NameIdentifier getGravitinoNameIdentifier(
return NameIdentifier.of(catalogNS.toArray(String[]::new));
}
+ public static Map<String, String> getHttpHeaders(HttpServletRequest
httpServletRequest) {
+ Map<String, String> headers = new HashMap<>();
+ Enumeration<String> headerNames = httpServletRequest.getHeaderNames();
+ while (headerNames.hasMoreElements()) {
+ String headerName = headerNames.nextElement();
+ String headerValue = httpServletRequest.getHeader(headerName);
+ if (headerValue != null) {
Review Comment:
According to the API, the headerValue will be null if `headerName` is not in
HTTP request headers. In theory the headerValue will not be null in current
implement, but it's safe to add the check here.
--
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]