Closed hoxu closed 8 years ago
Actually this issue might be invalid. I think I got confused because with Compojure 1.1.5 the URL seemed to be decoded twice, so URLs containing "/" were matched regardless of whether they were urlencoded or not.
Now that I think about it, Compojure 1.4.0 is probably working just right - the regexp must indeed be matched against still-urlencoded path.
Maybe URL decoding and pattern matching should be covered in the wiki in more detail.
Yes, this is deliberate behaviour. The regular expression matches against the URL itself, not the decoded path. When the URL is decoded, information is lost (e.g. %2F
and /
both translate to the same thing). This was causing problems for a bunch of things, including the context
macro.
Right! Thanks for the reply, I'm closing this issue.
With compojure 1.4.0 this syntax matches against the encoded url component:
/123%2F456
matches this route, andtest
gets123/456
assigned.I would expect the regexp to match against the decoded version of the component - eg. the same string that gets assigned to
test
. This is how it seemed to work before, at least in compojure 1.1.5.I would expect the following to work, but it does not: