-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Routes should match with and without trailing slash #97
Comments
Any particular reason why this feature wasn't accepted? |
I would also like to know why this wasn't accepted. I would very much like this feature. A trailing slash is often added to request URLs and, as far as I know, it is still the same meaning for RESTful operations. |
Ditto for me. This would remove a lot of duplicated routes |
Technically they are all different routes /route and /route/ are different from each other. So Spark is preforming the correct action that needs to be done. |
Perhaps there could be a built-in configuration option for Spark that would allow for both routes to be created with the same handler (that defaults to off)? |
The URI spec says they are different only if they are actually different, and if they are the same then one should redirect to the other. Remember that this mostly comes from Unix file systems where no-slash means file and a slash means folder. In terms of most websites and the expectations of most end users the expectation is that they are the same. I would suggest there be a option to force redirects to / automatically and that this option is on by default. |
It would be nice if "/route" match "/route" and also "/route/"
Not a big issue. but some browsers put the trailing slash automatically, so sometimes it's annoying.
The text was updated successfully, but these errors were encountered: