Skip to content

Commit

Permalink
Fix #6305 Optimise isProtectedTarget
Browse files Browse the repository at this point in the history
updates from review

Signed-off-by: Greg Wilkins <[email protected]>
  • Loading branch information
gregw committed May 21, 2021
1 parent 9ae227a commit df77165
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,13 @@ public void testProtected() throws Exception
assertTrue(handler.isProtectedTarget("/FOO-inf?"));
assertTrue(handler.isProtectedTarget("/FOO-INF;"));
assertTrue(handler.isProtectedTarget("/foo-INF#"));
assertTrue(handler.isProtectedTarget("//foo-inf"));
assertTrue(handler.isProtectedTarget("//foo-inf//some//path"));
assertTrue(handler.isProtectedTarget("///foo-inf"));
assertTrue(handler.isProtectedTarget("/foo-inf/x/y/z"));
assertFalse(handler.isProtectedTarget("/foo/x/y/z"));
assertTrue(handler.isProtectedTarget("/foo-inf?x=y&z=1"));

assertFalse(handler.isProtectedTarget("/foo/x/y/z"));
assertFalse(handler.isProtectedTarget("/foo-inf-bar"));

protectedTargets = new String[4];
Expand Down

0 comments on commit df77165

Please sign in to comment.