Skip to content

Commit

Permalink
Merge pull request #6879 from EightMonth/springboot3_sas
Browse files Browse the repository at this point in the history
修复访问仪表盘401
  • Loading branch information
zhangdaiscott authored Jul 10, 2024
2 parents cf7f3f9 + 7d8b653 commit f4712ba
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
// 以下为undertow定制代码,如切换其它servlet容器,需要同步更换
HttpServletRequestImpl undertowRequest = (HttpServletRequestImpl) request;
String bearerToken = request.getParameter("token");
String headerBearerToken = request.getHeader("X-Access-Token");
if (StringUtils.hasText(bearerToken)) {
undertowRequest.getExchange().getRequestHeaders().add(new HttpString("Authorization"), "bearer " + bearerToken);
} else if (StringUtils.hasText(headerBearerToken)) {
undertowRequest.getExchange().getRequestHeaders().add(new HttpString("Authorization"), "bearer " + headerBearerToken);
}
filterChain.doFilter(undertowRequest, response);
}
Expand Down

0 comments on commit f4712ba

Please sign in to comment.