cbcrc / koco-router

Simple Knockout router
MIT License
2 stars 1 forks source link

Incorrect url mapping ? #6

Closed th3answer closed 9 years ago

th3answer commented 9 years ago

When adding the following route :

router.addRoute(urlUtility.patternWithQueryString('tracks/:id:'), {
     pageName: 'tracks-edit'
});

this maps to "tracks/1", "tracks/" (notice the trailing slash) AND (surprisingly enough) to "tracks". I've noticed that when the router tries to resolve "tracks/" (with a trailing slash) the router redirects to "tracks" (without the trailing slash) when in my opinion it should redirect to a 404 page, given that it didn't find the resource (in this case the id is empty since there's nothing after the trailing slash).

What are your thoughts on this ?

th3answer commented 9 years ago

Problem solved using {id} instead of : id :