yada

martinklepsch 2018-05-23T06:52:24.000241Z

Not only yada specific but how do you deal with urls that may or may not have a trailing slash? e.g https://cljdoc.xyz/d/spicerack/spicerack/0.1.4/ vs. https://cljdoc.xyz/d/spicerack/spicerack/0.1.4 Is it common to redirect to the URLs with the trailing slash? Are there any helpers for this kind of thing?

dominicm 2018-05-23T07:19:38.000190Z

Never had to solve this, but I speculate that something could walk the bidi structure and add those routes. It depends, as ever. In other ecosystems I see both redirecting and ignoring as common.

2018-05-23T07:26:18.000019Z

if I'm serving static content (which might contain relative urls) I'll generally redirect, if I'm serving an api endpoint I generally ignore the trailing slash

martinklepsch 2018-05-23T12:28:17.000568Z

Thanks, will add a redirect to one of them.

martinklepsch 2018-05-23T12:28:52.000110Z

btw, I asked about how to keep my route-tree plain data. This is what I ended up doing: https://github.com/martinklepsch/cljdoc/blob/master/src/cljdoc/routes.clj#L6-L23

martinklepsch 2018-05-23T13:21:52.000696Z

How can I set the response from an interceptor? (and prevent actual resource verbs to be called)

malcolmsparks 2018-05-23T13:59:41.000598Z

You can throw ex-info with :status set to status code and :response

martinklepsch 2018-05-23T14:22:52.000715Z

Is that “the way” to do things?

malcolmsparks 2018-05-23T15:31:42.000116Z

Not really, just a workaround. What would be a better design? Changing interceptor chain at runtime?

martinklepsch 2018-05-23T16:13:42.000518Z

From pedestal interceptors I’d probably empty the interceptor queue but my understanding of Yada’s interceptor impl is less good