Skip to content

Commit

Permalink
Do not add blank Bearer token (#588) (#591)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin <martinoneutrino@users.noreply.github.com>
Co-authored-by: Martin Glass <martin.glass@partner.co>
  • Loading branch information
3 people authored Dec 13, 2023
1 parent 68a4ef4 commit 120e3e7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ public void filter(ClientRequestContext requestContext) throws IOException {
} else {
bearerToken = getBearerToken();
}
requestContext.getHeaders().add(HttpHeaders.AUTHORIZATION,
AuthUtils.authTokenOrBearer(this.scheme, bearerToken));
if (!bearerToken.isBlank()) {
requestContext.getHeaders().add(HttpHeaders.AUTHORIZATION,
AuthUtils.authTokenOrBearer(this.scheme, bearerToken));
}
}

private String getBearerToken() {
Expand Down

0 comments on commit 120e3e7

Please sign in to comment.