Fix syntax-based URI normalization (fixes #262, alternative to #263)#265
Fix syntax-based URI normalization (fixes #262, alternative to #263)#265
Conversation
…ty segment Fixes #262.
There was a problem hiding this comment.
Thank you. I don't currently have a compiler ready and thus can't test this right now (will try to do tomorrow). But some thoughts based on looking at the diff and tests and having previously looked into this:
The // issue is only relevant when there is no authority. It might make sense to add a test case for http://example.com/.//foo and also to allow normalization in that case (I believe it should be http://example//foo). This would also alleviate my "concerns" (for lack a better word) that I raised in the issue: For a majority of URLs that users encounter (namely those with an authority), the path will be fully normalized.
@TimWolla thank you!
Interesting point, let me look into that case now… |
| - "/.//path1/path2" | ||
| - ".//path1/path2" | ||
| The fix is to not remove that dot segment. | ||
| Thanks to Tim Düsterhus for the report! |
There was a problem hiding this comment.
It might be appropriate to also thank @nyamsprod, who found and raised the issue for PHP. I just relayed the bug report after verifying it is not a bug in the PHP implementation.
There was a problem hiding this comment.
@TimWolla added 👍
@nyamsprod thanks for php/php-src#19897 ! 👍
3c8972e to
baf5b8f
Compare
@TimWolla spot on, spot on! I should note that current use of argument |
It also appears this is not actually tested anywhere. I have replaced the |
@TimWolla I came to a similar conclusion, yes.
Adding that and one more with the next push… |
baf5b8f to
e922ee1
Compare
This is specifically to backport uriparser/uriparser#265. Fixes php#19897.
This is specifically to backport uriparser/uriparser#265. Fixes #19897.
Fixes #262, alternative to #263
CC @TimWolla