This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-20
Channels
- # aws-lambda (7)
- # beginners (113)
- # boot (17)
- # cider (4)
- # cljs-dev (4)
- # clojure (65)
- # clojure-greece (3)
- # clojure-italy (7)
- # clojure-russia (10)
- # clojure-spec (37)
- # clojure-uk (20)
- # clojurescript (76)
- # community-development (2)
- # cursive (24)
- # data-science (9)
- # datomic (9)
- # emacs (1)
- # fulcro (2)
- # graphql (11)
- # hoplon (13)
- # juxt (15)
- # leiningen (1)
- # off-topic (36)
- # om (1)
- # onyx (59)
- # parinfer (41)
- # pedestal (7)
- # portkey (60)
- # protorepl (4)
- # re-frame (345)
- # reagent (7)
- # ring-swagger (16)
- # shadow-cljs (121)
- # spacemacs (30)
- # sql (6)
- # uncomplicate (2)
- # unrepl (9)
- # vim (13)
- # yada (2)
Hi guys, I’m new here 😄 I have a question about the short-circuit logic. It seems to be not working in the way I understand it. I’m on 0.5.3 and if I try to return a response from any interceptor, the next one is called and ends up overriding the already set response.
Is there anything that needs to be enabled in order to make it work as it’s written on the docs? I already spent few hours on this without finding a solution
@francesco686 are you calling io.pedestal.interceptor.chain/terminate prior to providing the response? Like this:
(if-not (= id expected-id)
(-> context
io.pedestal.interceptor.chain/terminate
(assoc :response {:status 401 :body {:message "Unauthorized"}})))
@jjttjj no, I thought this step was not need. Also going back to the 24th of March, some guys in this channel were actually saying it was not needed. Link: https://clojurians-log.clojureverse.org/pedestal/2017-03-24.html
ah, found out, I was missing the :headers
key on the response object. Without that, the terminator interceptor is not injected.
unfortunately also this one fails. https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/http/content_negotiation.clj#L172 I’m gonna open a PR now…