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

BrowserRouter basename is case sensitive #4866

Closed
nomad3k opened this issue Mar 29, 2017 · 2 comments
Closed

BrowserRouter basename is case sensitive #4866

nomad3k opened this issue Mar 29, 2017 · 2 comments
Labels

Comments

@nomad3k
Copy link

nomad3k commented Mar 29, 2017

Version

4.0.0

Test Case

Use BrowserRouter and set the basename property. Routes are not case-sensitive, but the Router is.

Steps to reproduce

<Router basename='/xxx'>
    <Route path='/yyy' component={Something} />
</Router>

Expected Behavior

Should match all of the following:

http://example.com/xxx/yyy
http://example.com/xxx/YYY
http://example.com/XXX/yyy
http://example.com/XXX/YYY

Actual Behavior

http://example.com/xxx/yyy - PASS
http://example.com/xxx/YYY - PASS
http://example.com/XXX/yyy - FAIL
http://example.com/XXX/YYY - FAIL

While the route is not case sensitive the router basename is.

@timdorr timdorr added the bug label Mar 29, 2017
@timdorr
Copy link
Member

timdorr commented Mar 29, 2017

Hmm, this is interesting. We don't include the basename in our usage of path-to-regexp, so that's why there's a difference. Should be as simple as toLowercase()'ing the pathname when matching.

@pshrmn
Copy link
Contributor

pshrmn commented Apr 20, 2017

Fixed with remix-run/history#459

@pshrmn pshrmn closed this as completed Apr 20, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants