Replies: 1 comment
-
is this still a thing in 4? sounds like a bug. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We're using Micronaut 3.x.
We've observed that if we return HttpResponse from a controller endpoint, micronaut/netty returns transfer-encoding: chunked to HTTP 1.1 clients.
If we change our endpoint to explicitly return (java) void, then we do NOT see the chunked encoding response and instead, the content length response header is explicitly set to 0.
Possibly this relates to this logic:
micronaut-core/http-server/src/main/java/io/micronaut/http/server/RouteExecutor.java
Line 498 in ecc1387
In the reactive response docs, https://docs.micronaut.io/latest/guide/#reactiveResponses, there is this note:
When returning a Reactive type, its type affects the returned response. For example, when returning a [Flux](https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html), the Micronaut framework cannot know the size of the response, so Transfer-Encoding type of Chunked is used. Whilst for types that emit a single result such as [Mono](https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html) the Content-Length header is populated.
If the controller returns HttpResponse is chunked transfer encoding the expected behavior ?
Beta Was this translation helpful? Give feedback.
All reactions