Fork me on GitHub
#yada
<
2017-05-19
>
frozenlock16:05:18

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)

frozenlock16:05:49

Everything is fine if my handler is wrapped in a deref (for figwheel), but it crashes otherwise.

frozenlock16:05:54

---> 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}

frozenlock16:05:04

Any clues as to what I'm missing?

frozenlock17:05:49

That rabbit hole...

frozenlock17:05:11

Server1 is using yada/aleph.

frozenlock17:05:25

Server2 is also using yada/aleph

frozenlock17:05:22

Server2 is configured as a proxy. No problem when using figwheel (deref handler and http-kit)

frozenlock17:05:55

But when using aleph on server2, server1 returns the 415 error.

frozenlock17:05:03

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" "manifold.stream.BufferedStream@7c43ba4d"])

malcolmsparks17:05:06

415 is to do with request content type. Is the proxy filtering headers or mutating the request on some way?

frozenlock17:05:41

But it works fine when developing in figwheel... 😕

frozenlock18:05:17

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.

frozenlock18:05:22

The weird thing is that if Server 1 isn't using Aleph, it works.

frozenlock18:05:41

So if any of those 2 servers is not using Aleph, it works. 😕

frozenlock18:05:44

@malcolmsparks : Should I open an issue with Aleph, or is this somehow dependent on Yada?

malcolmsparks18:05:55

Raise an issue wit yada unless you can remove yada entirely

stijn19:05:01

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

stijn19:05:40

nevermind, i can use 1.2.1 🙂