Closed srobertson421 closed 5 years ago
Describe the bug When programmatically routing using router.navigate, parameters are converted to lowercase. Could be due to URL encoding methods.
This code:
const id = 'WVPvZIHkGdoi1UlSsSdF'; nav.navigate(`/deal/${id}`);
produces this URL: /deal/wvpvzihkgdoi1ulsssdf
/deal/wvpvzihkgdoi1ulsssdf
this is the route code:
app.path('/deal/:id', async (req, res) => { if(!$user && req.routePattern !== '/auth') { res.redirect('/auth'); } else { const Deal = await import('./views/Deal.svelte'); res.mount(Deal.default, { req, nav: app }); } });
To Reproduce Steps to reproduce the behavior:
Expected behavior Expect route param to not be changed
Desktop (please complete the following information):
Additional context Was solved at one point by this PR: https://github.com/alshdavid/crayon/pull/31
Looks like this is the culprit: https://github.com/alshdavid/crayon/blob/master/src/router/src/platform/history/history.ts#L69
Should be:
path = url.normalise(path, false);
I can open a PR
Merged
https://github.com/alshdavid/crayon/pull/41
Describe the bug When programmatically routing using router.navigate, parameters are converted to lowercase. Could be due to URL encoding methods.
This code:
produces this URL:
/deal/wvpvzihkgdoi1ulsssdf
this is the route code:
To Reproduce Steps to reproduce the behavior:
Expected behavior Expect route param to not be changed
Desktop (please complete the following information):
Additional context Was solved at one point by this PR: https://github.com/alshdavid/crayon/pull/31