Skip to content

Commit 9814595

Browse files
author
Vladimir Kotal
committed
declare+define
1 parent 48a4644 commit 9814595

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

opengrok-web/src/main/java/org/opengrok/web/api/v1/filter/IncomingFilter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ public void filter(final ContainerRequestContext context) {
101101
String path = context.getUriInfo().getPath();
102102

103103
if (request.isSecure()) {
104-
String authHeaderValue;
105-
if ((authHeaderValue = request.getHeader(HttpHeaders.AUTHORIZATION)) != null &&
106-
authHeaderValue.startsWith(BEARER)) {
104+
String authHeaderValue = request.getHeader(HttpHeaders.AUTHORIZATION);
105+
if (authHeaderValue != null && authHeaderValue.startsWith(BEARER)) {
107106
String tokenValue = authHeaderValue.substring(BEARER.length());
108107
if (RuntimeEnvironment.getInstance().getAuthenticationTokens().contains(tokenValue)) {
109108
logger.log(Level.FINEST, "allowing request to {0} based on authentication header token", path);

0 commit comments

Comments
 (0)