-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
Version
4.x and 5.x
Context
I used http proxy to forward grpc requests, but I encountered a bug
java.lang.IllegalStateException: You must set the Content-Length header to be the total size of the message body BEFORE sending any data if you are not using HTTP chunked encoding.
at io.vertx.core.http.impl.HttpClientRequestImpl.write(HttpClientRequestImpl.java:488)
at io.vertx.core.http.impl.HttpClientRequestImpl.write(HttpClientRequestImpl.java:464)
at io.vertx.core.http.impl.HttpClientRequestImpl.write(HttpClientRequestImpl.java:41)
at io.vertx.core.streams.impl.PipeImpl.lambda$to$1(PipeImpl.java:78)
at io.vertx.core.impl.ContextBase.emit(ContextBase.java:82)
...
I found that in HttpClientRequestImpl#requiresContentLength, there was no judgment on the situation where h2 does not need to be chunked.
At the same time, when this error occurred, the request still did not end. Should the proxiedRequest be closed when an exception occurs in the http proxy write.

Steps to reproduce
No response
Do you have a reproducer?
No response