You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite the fact that we set a request body, it is not sent to the server. If we set the JDK client logging to log requests and headers, we see it is sending a Content-Length of 0:
A coworker and I spent some time debugging this because it was so surprising. The cause seems to be the fact that the Content-Length header is not generated when you add a body using the circe BodySerializer (unlike if you set a raw string body). This then produces a http4s request without content-length header, which is passed to the JDK http client via the http4s wrapper. The JDK client in turn seems to have a problem where it needs all the content headers to be present: it somehow falls back to 0 content-length and does not send the body. (This was true on all versions of Java I tried.)
I admit that I'm not sure what point in the chain would be the right place to start fixing this, or whether a similar issue might affect any other backends that end up using a JDK http client in the end.
The text was updated successfully, but these errors were encountered:
Minimal example to reproduce
Despite the fact that we set a request body, it is not sent to the server. If we set the JDK client logging to log requests and headers, we see it is sending a Content-Length of 0:
Cause
A coworker and I spent some time debugging this because it was so surprising. The cause seems to be the fact that the Content-Length header is not generated when you add a body using the circe BodySerializer (unlike if you set a raw string body). This then produces a http4s request without content-length header, which is passed to the JDK http client via the http4s wrapper. The JDK client in turn seems to have a problem where it needs all the content headers to be present: it somehow falls back to 0 content-length and does not send the body. (This was true on all versions of Java I tried.)
I admit that I'm not sure what point in the chain would be the right place to start fixing this, or whether a similar issue might affect any other backends that end up using a JDK http client in the end.
The text was updated successfully, but these errors were encountered: