Skip to content

Parameters matching/Update path-to-regexp? #2446

@Lassi

Description

@Lassi

Hi,

I've noticed something weird about named parameters in routes. In our app, we use a route similar to this one:

app.get('/concerts/:id*/videos', function (req, res) {});

where the id of a concert is a string formatted like that:

'yyyy/mm/dd/venue/artist'

Now the problem is, if we hit that route:

'/concerts/2014/11/21/venue/artist/videos'

the field req.params.id isn't populated with the value '2014/11/21/venue/artist' as expected, it only contains the value '2014'.

I was wondering if this is the intended behaviour or if this is a bug? I tried to update path-to-regexp from 0.1.3 to its latest version and then everything seemed to work just the way I though it would work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions