Fork me on GitHub
#pedestal
<
2018-09-24
>
mavbozo06:09:49

@deadghost you put those 3 interceptors at the end of interceptor chain, ex: ::http/interceptors becomes [... your-interceptors ... mw-cookies intc/content-negotiate intc/coerce-body].

mavbozo06:09:50

above contain example to add interceptor(s) to the service map after default-interceptors applied to service map

deadghost11:09:02

@mavbozo thanks for the tip, still not working after several reorder tries

deadghost17:09:54

default interceptors get run before route specific interceptors right?

mavbozo17:09:03

it is more precise to say that io.pedestal.http/default-interceptors creates interceptors based on the options given then creates routing interceptor and finally conj those interceptors to :io.pedestal.http/interceptors key in the service map

deadghost19:09:18

ended up getting content-negotiate working as a default interceptor

deadghost19:09:42

no idea why I can't get it working with coerce-body

deadghost19:09:35

I thought it'd be fine to have it at the top of the default interceptor stack because then it will 100% be registered before a :response short circuits the thing, and as it is at the top it should be the last interceptor to be applied

deadghost19:09:29

I have a print in coerce-body which prints as a route interceptor but not a default interceptor meaning it's highly likely it's just not being called for some reason

deadghost20:09:07

I see the default interceptors I have working are of type io.pedestal.interceptor.Interceptor while the one I'm having issue with is an interceptor spec of type clojure.lang.PersistentArrayMap

deadghost20:09:32

do I need to take an additional step to convert the map into an Interceptor?

ddeaguiar20:09:38

yes, use the io.pedestal.interceptor/interceptor function to create your interceptor.