Fork me on GitHub
#pedestal
<
2016-11-22
>
jimmy11:11:30

hi guys, in pedestal doesn't route /* hits / as well. I have route declaration as /* and it only works with /<something-here> and it doesn't work with /

ddeaguiar19:11:29

@nxqd that's not what I would expect but is how Pedestal behaves. I can't comment on whether this is by design or not.

mtnygard19:11:45

@nxqd @ddeaguiar Does the behavior vary with different routers?

ddeaguiar19:11:21

I had run a quick test across different routers and observed the same behavior

ddeaguiar19:11:19

Although I find this behavior odd:

(def rs (route/expand-routes #{["/*"
                                :get
                                [(fn [req] "test")]
                                :route-name ::test]}))

(route/try-routing-for rs :linear-search "/foo" :get) ;; => nil

ddeaguiar20:11:04

whereas a different router finds a match

ddeaguiar20:11:32

I guess the :linear-search router does not support *? I've not looked through the source