Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
Signed-off-by: Greg Wilkins <gregw@webtide.com>
  • Loading branch information
gregw committed Sep 29, 2021
1 parent 53818e5 commit bc60a9b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1947,13 +1947,14 @@ public void setComplianceModes(HttpCompliance compliance, HttpComplianceSection.
@Test
public void testAmbiguousPaths() throws Exception
{
// TODO this is a poor test as it is not very exhaustive. See HttpURITest for better tests.
_handler._checker = (request, response) ->
{
response.getOutputStream().println("servletPath=" + request.getServletPath());
response.getOutputStream().println("pathInfo=" + request.getPathInfo());
return true;
};
String request = "GET /unnormal/.././path/ambiguous%2f%2e%2e/%2e;/info HTTP/1.0\r\n" +
String request = "GET /unnormal/.././path/ambiguous%2f%2e%2e/info HTTP/1.0\r\n" +
"Host: whatever\r\n" +
"\r\n";

Expand All @@ -1962,7 +1963,7 @@ public void testAmbiguousPaths() throws Exception
startsWith("HTTP/1.1 200"),
containsString("pathInfo=/path/info")));

setComplianceModes(HttpComplianceSection.NO_AMBIGUOUS_PATH_SEGMENTS);
setComplianceModes(HttpComplianceSection.NO_AMBIGUOUS_PATH_SEPARATORS);
assertThat(_connector.getResponse(request), startsWith("HTTP/1.1 400"));
}

Expand Down

0 comments on commit bc60a9b

Please sign in to comment.