Skip to content

Commit 37b0eda

Browse files
gaborbernatvladak
authored andcommitted
Allow to query to index time endpoint without token
Signed-off-by: Bernát Gábor <[email protected]>
1 parent a6b6ac3 commit 37b0eda

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class IncomingFilter implements ContainerRequestFilter, ConfigurationChan
7373
private static final Set<String> allowedPaths = new HashSet<>(Arrays.asList(
7474
SearchController.PATH, SuggesterController.PATH, SuggesterController.PATH + "/config",
7575
HistoryController.PATH, FileController.PATH, AnnotationController.PATH,
76-
SystemController.PATH + "/ping"));
76+
SystemController.PATH + "/ping", SystemController.PATH + "/indextime" ));
7777

7878
@Context
7979
private HttpServletRequest request;

opengrok-web/src/test/java/org/opengrok/web/api/v1/filter/IncomingFilterTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,9 @@ void systemPathDescWithoutTokenTest() throws Exception {
243243

244244
assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), captor.getValue().getStatus());
245245
}
246+
247+
@Test
248+
void systemIndexTimeRemoteWithoutTokenTest() throws Exception {
249+
assertFilterDoesNotBlockAddress("10.0.0.1", "system/indextime");
250+
}
246251
}

0 commit comments

Comments
 (0)