Skip to content

Commit 3344366

Browse files
author
Vladimir Kotal
committed
simplify conditions
1 parent bab6593 commit 3344366

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ public void filter(final ContainerRequestContext context) {
9898

9999
if (request.isSecure()) {
100100
String authHeader;
101-
if ((authHeader = request.getHeader(HttpHeaders.AUTHORIZATION)) != null) {
102-
if (RuntimeEnvironment.getInstance().getAuthenticationTokens().contains(authHeader)) {
103-
logger.log(Level.FINEST, "allowing request to {0} based on authentication header", path);
104-
return;
105-
}
101+
if (((authHeader = request.getHeader(HttpHeaders.AUTHORIZATION)) != null) &&
102+
RuntimeEnvironment.getInstance().getAuthenticationTokens().contains(authHeader)) {
103+
logger.log(Level.FINEST, "allowing request to {0} based on authentication header", path);
104+
return;
106105
}
107106
}
108107

0 commit comments

Comments
 (0)