-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix index matching with trailing slashes #16
base: master
Are you sure you want to change the base?
Conversation
…hes" This reverts commit 7a17fe0. Signed-off-by: Pedro Melo <[email protected]>
Signed-off-by: Pedro Melo <[email protected]>
Signed-off-by: Pedro Melo <[email protected]>
…th_info Signed-off-by: Pedro Melo <[email protected]>
Ok, works now. I've started by reverting the previous #8 fix, reverting the code changes from PR #11, and then added the new tests, and finally made the tests from #11 (most of them, some were just wrong) work. @jonswar I'll double check the tests, and test it with my app; then I'll update the docs (in this branch right now, they are wrong) and add them to this PR. |
Added the documentation test cases to the test suite. Signed-off-by: Pedro Melo <[email protected]>
Done, all test pass, documentation up-to-date. |
Signed-off-by: Pedro Melo <[email protected]>
Signed-off-by: Pedro Melo <[email protected]>
Testcases are still not complete, it feels like opening pandora's box ;-) Can you please have a look at test_decline a few lines later and the expected decline-order?
is not correct the correct order according to the docs but it matches successful. So here are the new tests:
Gets more and more confusing.
Now I will have a closer look on
as path_info was set to '/' in the old code but now it is always empty at the first loop. |
I need to take a break and step back from it all... With #8, I only wanted to make sure that path_info included the trailing slash if I requested id with allow_path_info => 1. That is all. I would like to run the current test suite on this PR with 2.19, and see if those tests that @pstadt mentions fail or not. If not, then they are correct, and the documentation is misleading, and needs to be updated. I don't want to change the matching semantics, just want to capture the trailing slash in path_info. @jonswar 2.20 is a broken release due to my #11 pull request. I think it should be reverted ASAP and release 2.21, and afterwards, if this PR is stable and makes sense, you can if you wish make a 2.22 release with it. If you agree, tell me and I'll prepare a new PR to revert #11. It should be as simple as cherry pick baa1643 from this PR and then remove the documentation (this patch melo@7a17fe0#L1R71 from lib/Mason/Manual/RequestDispatch.pod). I need to work now, I'll get back to this tomorrow with a fresher mind. |
I think we are on a good way. I am not sure if 2.19 is a good basis to work on, as it has contradictory statements about matching in code comments and RequestDispatch.pod (and an implementation). And 2.19 does not define how to deal with trailing slashes except in code. I think best is to go back to drawing board what should be the matching order. As far as I can see there might be only one incompatible change between new and old: thats what the decline_test complains about with latest changes. And it might not be necessary to do a quick 2.21 release because noone complained for half a year about the 2.20 release |
I don't know right now. If I ever see someone with So... I don't mind doing the work, but clearly, at least for me, a step back is required, and that means 2.19, because 2.20 with #11 clearly broke more that it fixed. |
Strictly spoken a dhandler is identical to an index component with the full meaning of allow_path_info if set: intercept on every level and return path_info. |
Played around a little with the test and 2.19, these are all successful:
I think the result of the 3rd test is a bug (only about components, not about path_info). |
Mason 2.20 fails in this situation: with a
index.mc
inside afoo/
directory:This pull request has the failing test cases for now. Working on a fix at the moment.