Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Routing] Route collection prefixes must start with a / and must not …
…end with a /
- Loading branch information
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98e70f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why it can't end with a '/', well of course it makes it easier to be sure that the next nested prefix starts with a slash, but I'd prefer explicitness here. Type /prefix, or /prefix/, or whatever you want, but if there is no / at the beginning of the URL, there should be an error.
98e70f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It cannot end with / as this is a prefix to something else that must start with a /.
98e70f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well ok, all I'm saying is it should throw an error if there is no leading slash, and if there is a trailing slash, instead of silently fixing it. Otherwise the routing file looks like a mess.
98e70f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is that it's late now to do this as it will probably break a lot of code (which routing file looks like a mess?).
98e70f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I think that
prefix: foo
when you really meanprefix: /foo
looks a bit messy. You specify urls, it should look like urls.