reitit icon indicating copy to clipboard operation
reitit copied to clipboard

Matching catch all path by name incorrectly url encodes the path

Open kennyjwilli opened this issue 3 years ago • 1 comments

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"

kennyjwilli avatar Sep 01 '20 16:09 kennyjwilli

Seems that this behaviour was added here: https://github.com/metosin/reitit/pull/193

rap1ds avatar Nov 24 '22 11:11 rap1ds