jetty.project
jetty.project copied to clipboard
Jetty-12 EE10 handling of %2F as Alias
Jetty version(s) jetty-12 ee10
Description
The org.eclipse.jetty.ee10.webapp.WebAppContextTest#testProtectedTarget has some important use-cases commented out with regards to handling of %2F
The new behaviour of servlet 6.0 allows a servletPath and/or pathInfo to contain a %2F as an encoded / character.
For example, a request to /WEB-INF%2Ftest.xml is currently resolving to a Resource with:
path=/home/gregwilkins/src/jetty-12/jetty-ee10/jetty-ee10-webapp/src/test/webapp/WEB-INF/test.xml
uri=file:/home/gregwilkins/src/jetty-12/jetty-ee10/jetty-ee10-webapp/src/test/webapp/WEB-INF%2Ftest.xml
alias=null
So this has been resolved incorrectly. Either the path should be for the (probably) non-existent WEB-INF%2Ftest.xml OR if it does resolve to WEB-INF/test.xml then is should be seen as an alias for that.
Commit edba0c3 "fixes" this issue by fixing a big in URIUtil that prevented the resource from being seen as an alias. However, a real fix should involve allowing an encoded %2F to be used to select a resource that actually has an encoded / in the filename? So I'm leaving this open for now.
Commit edba0c3 broke the org.eclipse.jetty.util.resource.FileSystemResourceTest.testAccessUniCodeFile test.
Looking into it now.
Closing, as we have plenty of test cases for this now in Jetty-12