]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: h1-htx: Skip C-L and T-E headers for 1xx and 204 messages during parsing
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 15 Apr 2025 16:56:18 +0000 (18:56 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 22 Apr 2025 14:14:47 +0000 (16:14 +0200)
commit1db99b09d031b332072518cc16ce48082427f0f1
treee510b97c22a6627e32e086410f4f3bd642311aab
parent52002036777c3ce189146df93d38597ee20d5b42
MINOR: h1-htx: Skip C-L and T-E headers for 1xx and 204 messages during parsing

According to the RFC9110 and RFC9112, a server must not add 'Content-Length'
or 'Transfer-Encoding' headers into 1xx and 204 responses. So till now,
these headers were dropped from the response when it is sent to the client.

However, it seems more logical to remove it during the message parsing. In
addition to sanitize messages as early as possible, this will allow us to
apply some exception in some cases (This will be the subject of another
patch).

In this patch, 'Content-Length' and 'Transfer-Encoding' headers are removed
from 1xx and 204 responses during the parsing but the same is still
performed during the formatting stage.
src/h1_htx.c