BUG/MEDIUM: h1: Reject empty Transfer-encoding header
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 9 Jul 2024 05:55:58 +0000 (07:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jul 2024 13:44:58 +0000 (15:44 +0200)
commit276c0ce8e0cd9a9f9235eda8eeaac1628e135b2f
treed8168ea47a9e50a5a6c8391ea2d4ca427a04e8f5
parentf403f36c2a83fa6f4cec9eca17ff240b4a1213b9
BUG/MEDIUM: h1: Reject empty Transfer-encoding header

The Transfer-Encoding headers list the transfer coding that have been
applied to the content in order to form the message body. It is a list of
tokens. And as specified by RFC 9110, a token cannot be empty. When several
coding names are specify as a comma-separated value, this case is properly
handled and an error is triggered. However, an empty header value will just
be skipped and no error is triggered. This could be an issue with some buggy
servers.

Now, empty Transfer-Encoding header are rejected too.

This patch must be backported as far as 2.6.

(cherry picked from commit 4a2dd6f3777959187565edd79475091e155e2161)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/h1.c