-
After updating to uws.js 17.4 some of my tests failed. When looking into why I've stumbled upon something that appears to be a regression resulting from the fix of my afformentioned issue so I thought I'd report it: Test setup:
Result
Changing the route to be The way I get it a trailing slash in a request should not matter to whats actually matched, that was the case in 17.3 as having the route or request feature a trailing slash did not change the outcome. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Technically trailing slash is not the same URL (that's my interpretation at least): https://stackoverflow.com/questions/5948659/when-should-i-use-a-trailing-slash-in-my-url /foo/ and /foo/?bar have segments like so: ["foo", ""] While /foo only has ["foo"] so it's not the same URL. You can redirect one to the other if you like |
Beta Was this translation helpful? Give feedback.
-
I almost thought so, just wanted to make sure it's not an oversight. Alright, thank you. |
Beta Was this translation helpful? Give feedback.
-
I'll keep this closed (For now), but I'll add some info: I've checked out how Express and Polka handle it. With both of them it does not matter if the route you define does or does not have a trailing slash, it will always match requests of both. I dont know how much you care about compatability with the Node ecosystem as this is not built specifically for it, but seeing how it was working in the same fashion before maybe it might make sense to make it do so again. |
Beta Was this translation helpful? Give feedback.
-
Seeing how swiftly you usually respond I guess you arent subscribed to the Issue, so just to make sure you see the above: @alexhultman I've also in the meanwhile checked how Nginx handles it, having a |
Beta Was this translation helpful? Give feedback.
-
I thought we already agreed - they are different URLs. If you want to put the same handler on both cases, then do so. The other way around doesn't work. If more people want this change then I can consider it but I don't plan on making any routing changes right now. Nobody else has reported this as an issue. |
Beta Was this translation helpful? Give feedback.
Technically trailing slash is not the same URL (that's my interpretation at least): https://stackoverflow.com/questions/5948659/when-should-i-use-a-trailing-slash-in-my-url
/foo/ and /foo/?bar have segments like so:
["foo", ""]
While /foo only has ["foo"] so it's not the same URL.
You can redirect one to the other if you like