Skip to content

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

@thedustin

Description

@thedustin

Stencil version:

my-project@0.0.1
├── @stencil/core@2.13.0
├─┬ @stencil/store@2.0.1
│ └── @stencil/core@2.13.0 deduped
└─┬ stencil-router-v2@0.6.0
  ├── @stencil/core@2.13.0 deduped
  └─┬ @stencil/store@1.5.0
    └── @stencil/core@2.13.0 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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions