japplis opened a new pull request, #542: URL: https://github.com/apache/commons-vfs/pull/542
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. I don't know why it shows a big diff when I only changed a few lines in `UriParser`. I guess it may have to do with the line feed but I've read many post on internet and tried many things for 1 hour without any result. If it's a problem let me know, I'll do a clean clone again and recreate the change. -- 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]
