Skip to content

Commit bab6593

Browse files
author
Vladimir Kotal
committed
restructure allow cases
1 parent 76fa127 commit bab6593

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,15 @@ public void filter(final ContainerRequestContext context) {
107107
}
108108

109109
if (allowedPaths.contains(path)) {
110-
logger.log(Level.FINEST, "allowing request to {0} based on allowed path", path);
110+
logger.log(Level.FINEST, "allowing request to {0} based on whitelisted path", path);
111111
return;
112112
}
113113

114-
if (!localAddresses.contains(request.getRemoteAddr())) {
115-
logger.log(Level.FINEST, "denying request to {0} based on source IP address", path);
116-
context.abortWith(Response.status(Response.Status.UNAUTHORIZED).build());
114+
if (localAddresses.contains(request.getRemoteAddr())) {
115+
logger.log(Level.FINEST, "allowing request to {0} based on localhost IP address", path);
116+
return;
117117
}
118+
119+
context.abortWith(Response.status(Response.Status.UNAUTHORIZED).build());
118120
}
119121
}

0 commit comments

Comments
 (0)