Skip to content

Expecting 405, getting routed to a param path instead #1035

@bekabaz

Description

@bekabaz

When I use regex with a path such as /users/{id:[0-9]+} this works really well to prevent static paths such as /users/me from being matched incorrectly. That is an issue of it's own really, and I was expecting go-chi to have better static matching than it does. Anyway, the regex on the path variable fixed that, however, it does not work when you have an additional subpath. For instance, when I create a route for /profiles/{id:[0-9]+}/usage this throws a 404 not found. The only way to make it work is to remove the regex, and then it's not the same style as the others where I must use {id:[0-9]+}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions