Bug 1830359 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

https://datatracker.ietf.org/doc/html/rfc9113#section-8.1.1-2
> A request or response that includes message content can include a `content-length` header field. A request or response is also malformed if the value of a `content-length` header field does not equal the sum of the [DATA](https://datatracker.ietf.org/doc/html/rfc9113#section-8.1.1-2#DATA) frame payload lengths that form the content, unless the message is defined as having no content. For example, 204 or 304 responses contain no content, as does the response to a HEAD request. A response that is defined to have no content, as described in [Section 6.4.1](https://www.rfc-editor.org/rfc/rfc9110#section-6.4.1) of \[[HTTP](https://datatracker.ietf.org/doc/html/rfc9113#section-8.1.1-2#RFC9110)\], MAY have a non-zero `content-length` header field, even though no content is included in [DATA](https://datatracker.ietf.org/doc/html/rfc9113#section-8.1.1-2#DATA) frames.

We should make sure to include some WPT tests for this, and preferably some telemetry to see how often this happens.
https://datatracker.ietf.org/doc/html/rfc9113#section-8.1.1-2
> A request or response that includes message content can include a `content-length` header field. A request or response is also malformed if the value of a `content-length` header field does not equal the sum of the [DATA](https://datatracker.ietf.org/doc/html/rfc9113#section-8.1.1-2#DATA) frame payload lengths that form the content, unless the message is defined as having no content. For example, 204 or 304 responses contain no content, as does the response to a HEAD request. A response that is defined to have no content, as described in [Section 6.4.1](https://www.rfc-editor.org/rfc/rfc9110#section-6.4.1) of \[[HTTP](https://datatracker.ietf.org/doc/html/rfc9113#section-8.1.1-2#RFC9110)\], MAY have a non-zero `content-length` header field, even though no content is included in [DATA](https://datatracker.ietf.org/doc/html/rfc9113#section-8.1.1-2#DATA) frames.

> For malformed requests, a server MAY send an HTTP response prior to closing or resetting the stream. Clients MUST NOT accept a malformed response.

We should make sure to include some WPT tests for this, and preferably some telemetry to see how often this happens.

Back to Bug 1830359 Comment 0