japplis opened a new pull request, #543:
URL: https://github.com/apache/commons-vfs/pull/543

   The detection of %2f in `UriParser.readNonSeparator()` is incorrect as it 
always compare a String of length 2 with a String of length 3.
   
   After the fix, a unit test failed:
   `NamingTests` -> `assertSameName(path, name, "foo%2f..%2fa", scope);`
   The reason was before the fix the resolved path was 
'/Java/libraries/commons-vfs/commons-vfs2/target/test-classes/test-data/read-tests/foo%2f..%2fa'
   After the fix the resolved path is 
'/Java/libraries/commons-vfs/commons-vfs2/target/test-classes/test-data/read-tests%2fa'
   `AbstractFileName.checkName` (with scope child) wasn't failing first as 
`path.charAt(baseLen)` was '/' (the '/' before foo)
   then it was failing as the separator at baseLen was %2f and not '/'.
   So I've changed the `UriParser.PathNormalizer.readSeparator()` to also 
normalize the '%2f' to '/'. This fixes the unit tests.
   
   While adding more unit tests, I also noticed the different handling of '/' 
and %2f in `UriParser.normalisePath()` and fixed it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to