File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/org/opensolaris/opengrok/web/api/v1/filter Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 34
34
import javax .ws .rs .ext .Provider ;
35
35
import java .io .IOException ;
36
36
import java .net .InetAddress ;
37
+ import java .util .Collections ;
37
38
import java .util .HashSet ;
38
39
import java .util .Set ;
39
40
import java .util .logging .Level ;
@@ -45,6 +46,8 @@ public class LocalhostFilter implements ContainerRequestFilter {
45
46
46
47
private static final Logger logger = LoggerFactory .getLogger (LocalhostFilter .class );
47
48
49
+ private static final Set <String > allowedPaths = Collections .singleton ("search" );
50
+
48
51
@ Context
49
52
private HttpServletRequest request ;
50
53
@@ -64,6 +67,11 @@ public void init() {
64
67
65
68
@ Override
66
69
public void filter (final ContainerRequestContext context ) {
70
+ String path = context .getUriInfo ().getPath ();
71
+ if (allowedPaths .contains (path )) {
72
+ return ;
73
+ }
74
+
67
75
if (!localAddresses .contains (request .getRemoteAddr ())) {
68
76
context .abortWith (Response .status (Response .Status .UNAUTHORIZED ).build ());
69
77
}
You can’t perform that action at this time.
0 commit comments