I'm encountering the same issues described in this StackOverflow question: https://stackoverflow.com/questions/50103208/haskell-reverse-proxy-issue
The problem arises when you use waiProxyTo to proxy a POST request with a non-empty body. You get WrongRequestBodyStreamSize N 0 where N is the actual size of the body. The exception is coming from the check here:
https://github.com/snoyberg/http-client/blob/fda028b633cc000d295caf1ad0bdbcde98ad5b6e/http-client/Network/HTTP/Client/Request.hs#L447
It seems to happen non-deterministically. I've tried to set up a simple repro but haven't found a simple way to trigger it outside of my more complex testing setup.
I have a solution which I'll post as a separate PR.
I'm encountering the same issues described in this StackOverflow question: https://stackoverflow.com/questions/50103208/haskell-reverse-proxy-issue
The problem arises when you use
waiProxyToto proxy a POST request with a non-empty body. You getWrongRequestBodyStreamSize N 0where N is the actual size of the body. The exception is coming from the check here:https://github.com/snoyberg/http-client/blob/fda028b633cc000d295caf1ad0bdbcde98ad5b6e/http-client/Network/HTTP/Client/Request.hs#L447
It seems to happen non-deterministically. I've tried to set up a simple repro but haven't found a simple way to trigger it outside of my more complex testing setup.
I have a solution which I'll post as a separate PR.