Skip to content

Captured groups in patterns clobber following path parameters #26

Description

@casphas

If a regex uses capturing groups, path parameters following the pattern get assigned values from the captured group, not the value from the path.

;; Clout version 2.1.2
(clout/route-matches (clout/route-compile "/:foo/:bar" {:foo #"a(bcd|ef)g"})
(mock/request :get "/abcdg/1"))
=> {:bar "bcd", :foo "abcdg"}

expected:
=> {:bar "1", :foo "abcdg"}

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