Skip to content

Support middleware hierarchy for wildcards #23

Description

@DerekDuchesne

Hello,

Currently, when registering middleware on paths with wildcards, you have to use the entire path, not just a prefix.

For example:
kami.Use("/users/", CheckAdminPermission) would affect /users/:id/likes/count because it contains the "/users/" prefix.

However:
kami.Use("/users/:id/", CheckAdminPermission) would not affect /users/:id/likes/count because of the wildcard ":id"

Would it be possible to support registering prefixes with wildcards in the future? Could you also update the documentation to say that the full path has to be used for wildcards?

I've also noticed that you can only register one middleware function per path with a wildcard. Is it feasible to add support for registering multiple middleware functions on a single path?

Thanks, and excellent project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions