Fix StrictHttpFirewall rules

Fixes: gh-5093
This commit is contained in:
Rob Winch 2018-03-08 21:29:31 -06:00
parent 93118f4e91
commit 5854f00977
2 changed files with 3 additions and 2 deletions

View File

@ -340,7 +340,7 @@ public class StrictHttpFirewall implements HttpFirewall {
return true; return true;
} }
if (path.indexOf("//") > 0) { if (path.indexOf("//") > -1) {
return false; return false;
} }

View File

@ -26,7 +26,8 @@ import static org.assertj.core.api.Assertions.fail;
*/ */
public class StrictHttpFirewallTests { public class StrictHttpFirewallTests {
public String[] unnormalizedPaths = { "/..", "/./path/", "/path/path/.", "/path/path//.", "./path/../path//.", public String[] unnormalizedPaths = { "/..", "/./path/", "/path/path/.", "/path/path//.", "./path/../path//.",
"./path", ".//path", ".", "/path//" }; "./path", ".//path", ".", "//path", "//path/path", "//path//path", "/path//path" };
private StrictHttpFirewall firewall = new StrictHttpFirewall(); private StrictHttpFirewall firewall = new StrictHttpFirewall();