fix: Don't send content length header for unary gRPC responses#2075
fix: Don't send content length header for unary gRPC responses#2075johanandren merged 2 commits intomainfrom
Conversation
|
In addition to the built in Netty interop tests I also manually tested this out with grpcurl and grpcui (possible they have the same underpinnings though) and both worked fine without the content length header. |
patriknw
left a comment
There was a problem hiding this comment.
LGTM if my question is not relevant
| headers = headers, | ||
| entity = HttpEntity(contentType, encodeDataToFrameBytes(codec, data, trailer)), | ||
| entity = | ||
| HttpEntity.Strict(contentType, encodeDataToFrameBytes(codec, data, trailer), reportContentLength = false), |
There was a problem hiding this comment.
there is no risk that this changes the behavior (for others) in undesired way and we should enable it via a config instead?
There was a problem hiding this comment.
I was also worried about that, but James has assured me. The Content-Length header is redundant with HTTP/2 but can be included for backwards compatibility, the binary gRPC protocol however was always only HTTP/2, so unlikely that some client would assume HTTP/1.1 stuff.
Motivation in #2071 depends on upstream Akka HTTP change akka/akka-http#4504