Skip to content

Commit

Permalink
#9972 tentative fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <[email protected]>
  • Loading branch information
lorban committed Jun 26, 2023
1 parent 89af30a commit f0c81bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2829,10 +2829,6 @@ public InputStream getResourceAsStream(String path)
@Override
public Set<String> getResourcePaths(String path)
{
// This is an API call from the application which may pass non-canonical paths.
// Thus, we canonicalize here, to avoid the enforcement of canonical paths in
// ContextHandler.this.getResource(path).
path = URIUtil.canonicalPath(path);
if (path == null)
return null;
return ServletContextHandler.this.getResourcePaths(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.either;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.instanceOf;
Expand Down Expand Up @@ -563,6 +564,10 @@ public void testGetResourcePaths() throws Exception
""");

assertThat(response, startsWith("HTTP/1.1 200 OK"));
assertThat(response, containsString("/WEB-INF"));
assertThat(response, containsString("/WEB-INF/lib"));
assertThat(response, containsString("/WEB-INF/lib/odd-resource.jar"));
assertThat(response, containsString("/nested-reserved-!#\\\\$%&()*+,:=?@[]-meta-inf-resource.txt"));
}


Expand Down

0 comments on commit f0c81bf

Please sign in to comment.