Skip to content

Commit

Permalink
HDDS-11096. Error creating s3 auth info for request with Authorizatio…
Browse files Browse the repository at this point in the history
…n: Negotiate (apache#6896)

(cherry picked from commit ed52aa9)
  • Loading branch information
adoroszlai committed Jan 29, 2025
1 parent bb07133 commit 7f9836e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,17 @@ public void doFilter(ServletRequest servletRequest,
String httpMethod = httpRequest.getMethod();
String uri = httpRequest.getRequestURI();
String authorizationHeader = httpRequest.getHeader("Authorization");
if (httpMethod.equalsIgnoreCase("GET") && authorizationHeader == null && uri
.equals("/")) {
if (httpMethod.equalsIgnoreCase("GET") && !containsAWSAuth(authorizationHeader) && uri.equals("/")) {
((HttpServletResponse) servletResponse).sendRedirect("/static/");
} else {
filterChain.doFilter(httpRequest, servletResponse);
}
}

private boolean containsAWSAuth(String authorizationHeader) {
return authorizationHeader != null && authorizationHeader.startsWith("AWS");
}

@Override
public void destroy() {

Expand Down

0 comments on commit 7f9836e

Please sign in to comment.