SyliusResourceBundle
SyliusResourceBundle copied to clipboard
Aleph sends chunked responses even over HTTP 1.0
HTTP 1.0 does not support Transfer-Encoding: chunked
, but when a client makes a request with HTTP 1.0 and the handler returns a :body
which is a channel, the server responds with 200 OK and a 1.1 chunked response. It should either return a 505 (HTTP Version Not Supported) or return a 200 OK with a Content-Length after buffering the entire response.
Is this still the case on Aleph 0.4.1?
Yes, there's some refactoring necessary to handle this properly.
While HTTP 1.0
does not support Transfer-Encoding
, Aleph is always returning HTTP 1.1
responses (today, until HTTP 2.0 support, which will also drop the Transfer-Encoding
header). Yes, it could return 505 Version Not Supported
to be a better citizen... but still... I don't think a lot of people are using HTTP 1.0
these days.
Aggregating the data in memory when requesting HTTP 1.0
is risky and could blow up servers in memory, so it cannot be really considered in my opinion.
There is a small chapter regarding a client behavior on the RFC 9110 [1] saying :
A recipient that receives a message with a major version number that it implements and a minor version number higher than what it implements SHOULD process the message as if it were in the highest minor version within that major version to which the recipient is conformant. A recipient can assume that a message with a higher minor version, when sent to a recipient that has not yet indicated support for that higher version, is sufficiently backwards-compatible to be safely processed by any implementation of the same major version.
Happy to re-open this if required but the current behavior is not that terrible.
[1] : https://httpwg.org/specs/rfc9110.html#message.control.data