morning JUXTers 🙂 think I've stumbled on a bug in bidi related to https://github.com/juxt/bidi/pull/128 - is here a good place to talk about it, or would you prefer github?
problem arises when a path param contains a colon, from what I can tell:
(bidi.bidi/match-route ["" {["/" :id] :handler}] "/foo") ; => {:route-params {:id "foo"}, :handler :handler}, as expected
(bidi.bidi/match-route ["" {["/" :id] :handler}] "/:foo") ; => nil :(
actually, I wonder whether that's even allowed? :thinking_face:
fix would mean adding :
to the segment-regex-group
for keywords, on which there's a comment:
;; This is a very common form, so we're conservative as a defence against injection attacks.
would that be acceptable?
(defn just-path
[path]
(apply str (take-while #(not= \? %) path))
=>
#"^([^?]+)"
yep - although it doesn't match when it's part of a route-param variable, because that's got a different regex