Skip to content

Commit

Permalink
Merge pull request #36835 from sahuefficy/main
Browse files Browse the repository at this point in the history
Duplicate Authorization Bearer Header Fix
  • Loading branch information
sberyozkin committed Nov 2, 2023
2 parents eb344f0 + 3c880cb commit 389a663
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected String getClientName() {

public void propagateToken(ResteasyReactiveClientRequestContext requestContext, String accessToken) {
if (accessToken != null) {
requestContext.getHeaders().add(HttpHeaders.AUTHORIZATION, BEARER_SCHEME_WITH_SPACE + accessToken);
requestContext.getHeaders().putSingle(HttpHeaders.AUTHORIZATION, BEARER_SCHEME_WITH_SPACE + accessToken);
} else {
LOG.debugf("Access token is null, aborting the request with HTTP 401 error");
abortRequest(requestContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class AbstractTokenRequestFilter implements ClientRequestFilter

public void propagateToken(ClientRequestContext requestContext, String token) throws IOException {
if (token != null) {
requestContext.getHeaders().add(HttpHeaders.AUTHORIZATION, BEARER_SCHEME_WITH_SPACE + token);
requestContext.getHeaders().putSingle(HttpHeaders.AUTHORIZATION, BEARER_SCHEME_WITH_SPACE + token);
} else {
LOG.debugf("Injected access token is null, aborting the request with HTTP 401 error");
abortRequest(requestContext);
Expand Down

0 comments on commit 389a663

Please sign in to comment.