Skip to content

Commit

Permalink
Cleanup in DefaultBearerTokenResolver.java
Browse files Browse the repository at this point in the history
Removed redundant method call
  • Loading branch information
Jyosua authored Nov 21, 2024
1 parent 77233da commit a9edc44
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public final class DefaultBearerTokenResolver implements BearerTokenResolver {
@Override
public String resolve(final HttpServletRequest request) {
final String authorizationHeaderToken = resolveFromAuthorizationHeader(request);
final String parameterToken = isParameterTokenSupportedForRequest(request)
? resolveFromRequestParameters(request) : null;
final boolean isParameterTokenSupported = isParameterTokenSupportedForRequest(request);
final String parameterToken = isParameterTokenSupported ? resolveFromRequestParameters(request) : null;
if (authorizationHeaderToken != null) {
if (parameterToken != null) {
BearerTokenError error = BearerTokenErrors
Expand All @@ -63,7 +63,7 @@ public String resolve(final HttpServletRequest request) {
}
return authorizationHeaderToken;
}
if (parameterToken != null && isParameterTokenEnabledForRequest(request)) {
if (parameterToken != null && isParameterTokenSupported) {
if (!StringUtils.hasText(parameterToken)) {
BearerTokenError error = BearerTokenErrors
.invalidRequest("The requested token parameter is an empty string");
Expand Down

0 comments on commit a9edc44

Please sign in to comment.