This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-19
Channels
- # ai (3)
- # aws (1)
- # beginners (94)
- # boot (26)
- # cider (3)
- # cljs-dev (99)
- # cljsrn (86)
- # clojure (263)
- # clojure-dusseldorf (4)
- # clojure-greece (22)
- # clojure-italy (2)
- # clojure-quebec (1)
- # clojure-russia (12)
- # clojure-spec (71)
- # clojure-uk (123)
- # clojurescript (92)
- # core-async (4)
- # cursive (13)
- # data-science (2)
- # datomic (123)
- # docker (2)
- # emacs (15)
- # events (1)
- # graphql (2)
- # hoplon (71)
- # jobs-discuss (7)
- # lumo (5)
- # off-topic (12)
- # om (6)
- # onyx (97)
- # other-languages (4)
- # overtone (2)
- # pedestal (1)
- # re-frame (20)
- # reagent (33)
- # remote-jobs (1)
- # ring-swagger (1)
- # rum (5)
- # slack-help (6)
- # uncomplicate (1)
- # unrepl (33)
- # untangled (48)
- # vim (23)
- # yada (21)
I'm using a simple proxy as one of my yada endpoint. (example : /proxy will cause the server to fetch /my-url and return its value to the client)
Everything is fine if my handler is wrapped in a deref (for figwheel), but it crashes otherwise.
---> Unsupported Media Type {:status 415, :message "Method does not declare that it consumes this content-type", :consumes #{"application/json" "application/transit+json" "application/edn"}, :content-type nil}
Any clues as to what I'm missing?
That rabbit hole...
Server1 is using yada/aleph.
Server2 is also using yada/aleph
Server2 is configured as a proxy. No problem when using figwheel (deref handler and http-kit)
But when using aleph on server2, server1 returns the 415 error.
Nailed it down a little more... It appears the problem is when the proxy is forwarding the request's body (#object[manifold.stream.BufferedStream "0x7c43ba4d" "[email protected]"])
415 is to do with request content type. Is the proxy filtering headers or mutating the request on some way?
Yes, it's basically this http://www.codegist.net/snippet/clojure/aleph-proxyclj_hiredman_clojure
But it works fine when developing in figwheel... 😕
When I update the body using bs/to-byte-array it seems to solve the problem, but I'm not sure if it's going to work every time.
The weird thing is that if Server 1 isn't using Aleph, it works.
So if any of those 2 servers is not using Aleph, it works. 😕
@malcolmsparks : Should I open an issue with Aleph, or is this somehow dependent on Yada?
Raise an issue wit yada unless you can remove yada entirely
hi @malcolmsparks when do you think you could cut a 1.2.3 release, because 1.2.2 has a bug in new-classpath-resource that I believe gets fixed by this commit https://github.com/juxt/yada/commit/1b947cd246c677184301d1add0694d21ac351f49#diff-22811799c5e828291e6141b24a805de2
but just to make sure 1.2.2 throws a ClassCastException on https://github.com/juxt/yada/blob/1.2.2/src/yada/resources/classpath_resource.clj#L45