Skip to content
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

Closed
jsnoriegam opened this issue Aug 31, 2013 · 6 comments
Closed

Routes should match with and without trailing slash #97

jsnoriegam opened this issue Aug 31, 2013 · 6 comments

Comments

@jsnoriegam
Copy link

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.

@otaviofff
Copy link

Any particular reason why this feature wasn't accepted?

@JohnStarich
Copy link

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.

@scaryclam
Copy link

Ditto for me. This would remove a lot of duplicated routes

@N0odlez
Copy link
Contributor

N0odlez commented Aug 23, 2016

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.

@JohnStarich
Copy link

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)?

@ryber
Copy link

ryber commented Aug 26, 2016

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.

https://tools.ietf.org/html/rfc3986#section-6.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants