reitit
reitit copied to clipboard
Matching catch all path by name incorrectly url encodes the path
When matching a catch all path by name, reitit url encodes the path. It seems like it should not. Below is the actual result.
(r/match->path
(r/match-by-name
(r/router ["/a/{*rest}" ::a])
::a
{:rest "foo/bar"}))
=> "/a/foo%2Fbar"
I would've expected "/a/foo/bar"
Another example.
(r/match->path
(r/match-by-name
(r/router ["/a/{*rest}" ::a])
::a
{:rest "foo/bar?a=1"}))
=> "/a/foo%2Fbar%3Fa%3D1"
Seems that this behaviour was added here: https://github.com/metosin/reitit/pull/193