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

Bug: Path parameter values will be converted to lowercase #145

Open
thedustin opened this issue Nov 8, 2022 · 0 comments
Open

Bug: Path parameter values will be converted to lowercase #145

thedustin opened this issue Nov 8, 2022 · 0 comments

Comments

@thedustin
Copy link

thedustin commented Nov 8, 2022

Stencil version:

[email protected]
├── @stencil/[email protected]
├─┬ @stencil/[email protected]
│ └── @stencil/[email protected] deduped
└─┬ [email protected]
  ├── @stencil/[email protected] deduped
  └─┬ @stencil/[email protected]
    └── @stencil/[email protected] deduped

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request

Current behavior:

Using the router with path parameters will make the router pass all parameter values in lowercase to the route/render function.

Expected behavior:

Parameters should be passed without any modifications to the route.

Steps to reproduce:

  1. Create a Router, and add a match-Route with a path parameter
  2. Open the route in a web browser with a parameter like 1Bs9hcV5usFhyVJuqaNP3Q (the Base58 version of an ULID)
  3. The value in the console will be 1bs9hcv5usfhyvjuqanp3q

Related code:

<Router.Switch>
  <Route path={match("/users/:id")} render={({id}) =>
    [console.dir(id)]
  }></Route>
</Router.Switch>

Other information:

The issue seems to be the "normalization" of the path in the router, but I'm not that familiar with the code, and are not sure what happens if the normalization would just be removed.

const params = matchPath(normalizePathname(testUrl), route.path);

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

No branches or pull requests

1 participant