-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
I have an app with two almost identical http endpoints. One of them returns a text string, another — the same string, but wrapped in ByteArrayInputStream. When I use options quarkus.http.limits.max-chunk-size
and quarkus.rest.output-buffer-size, the second endpoint returns chunked responses, but the first one does not.
Expected behavior
Both responses are chunked, since the application has compression disabled and neither the original RFC[1] nor Quarkus documentation[2][3] mention any exceptions for text data.
[1] https://datatracker.ietf.org/doc/html/rfc9112#section-7.1
[2] https://quarkus.io/guides/http-reference
[3] https://quarkus.io/guides/rest
Actual behavior
The application/octet-stream response is chunked, the text/plain is not
How to Reproduce?
git clone -b chunking [email protected]:fedinskiy/reproducer.git && cd reproducermvn clean quarkus:dev- Check the streamed endpoint:
$ curl -i localhost:8080/stream | head -n 5
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1178 0 1178 0 0 89262 0 --:--:-- --:--:-- --:--:-- 90615
HTTP/1.1 200 OK
Content-Type: application/octet-stream
transfer-encoding: chunked
Hello no.1
- Check the text endpoint:
$ curl -i localhost:8080/text | head -n 5
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1178 100 1178 0 0 172k 0 --:--:-- --:--:-- --:--:-- 191k
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
content-length: 1178
Hello no.1
Output of uname -a or ver
6.16.4-200.fc42.x86_64
Output of java -version
Java version: 21.0.8, vendor: Eclipse Adoptium
Quarkus version or git rev
Build tool (ie. output of mvnw --version or gradlew --version)
Apache Maven 3.9.6
Additional information
No response