-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Case Sensitive Option for Routes #1214 #1215
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
Conversation
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.
Could you add some test case, please?
I have one concern, it's about the route cache: if we allow overwriting routes, changing the caseSensitive option wouldn't do anything. We can also point it out in docs though, I don't see an actual use case for that but it's a gotcha 😆
I was looking at where to add tests. I couldn't find any similar tests in |
@posva I have added some tests, let me know if this is good. |
Do we have an eta for this? |
Sorry for the delay 😅 |
…RegexpOptions to RouteRecord. Used to support senstive matches and pass along more options to pathToRegexp. vuejs#1214
I'm looking into this again, there are some conflicts I'm fixing. I should get a working pr soon |
Right now, the global option doesn' work. I'm looking at that |
The things that I'm not sure yet:
|
Note to myself, do not forget to close #1214 when merging |
ping @yyx990803 tldr: #1215 (comment) |
When will this be merged ? |
I'm waiting for this merge as well. Is important to have consistency between indexed URLs with trailing slashes, otherwise there will be duplicate URLs for crawlers |
Champagne ! (that resolve also my point: #1443) Thx guys. |
Where is the For example the I have only : https://router.vuejs.org/en/api/options.html#routes that indicate the property exist, but I do not have any example or detail. Where I know ``{ strict: true }` exist and what is it's true purpose ? |
pathToRegexp github page |
I will add this information to the vue-router doc. Thx @rivieiraa ! |
It's pathToRegex(p)Options
It is correct to use |
So I have an issue. If I set On my server I create:
and with
With usage of
But what I have is that With usage of
... Normal? |
I understand your situation.
Nope, it doesn't actually. This particular pull request was about case sensitivity but also involved another pathToRegexp options as they all passed together. |
So, if I correctly understand, You know the link to this pull request? |
Sure, i believe there must be an option to strict trailing slashes more clearly (to make slash mandatory or to deprecate it). But as long as vue router uses pathToRegexp it's a problem of third party software and i'm not sure if it could be done anyways. |
I will ask to re-open it so. Thx a lot ! |
@haeresis I created an issue on the repo instead: pillarjs/path-to-regexp#112 Feel free to share your thoughts there |
@posva |
the same, it's just that caseSensitive seems like a very common use case |
Has this been removed? |
Added both a
caseSenstive
andpathToRegexpOptions
property on RouteConfig. ThecaseSensitive
property will override and add topathToRegexpOptions
which defaults to{}
.Along with that
RouteRecord
getspathToRegexpOptions
that comes fromRouteConfig