nitro
nitro copied to clipboard
Route params parsed incorrectly when it contains literals or multiple params
Environment
Nitro: 0.5.4 Node: 16.14.2
Reproduction
https://stackblitz.com/edit/nitro-8ovcqq?file=routes/one/%5Ba%5D.json.ts
Describe the bug
/routes/[a].json.js
URL: /foo.json
Expected params: { "a": "foo" }
Actual params: { "a.json": "foo.json" }
/routes/[a]-[b].js
URL: /foo-bar
Expected params: { "a": "foo", "b": "bar" }
Actual params: { "a-:b": "foo-bar" }
/routes/hello-[a].js
URL: /hello-foo
Expected params: { "a": "foo" }
Actual response: 404
Additional context
No response
Logs
No response