BUG/MINOR: h1-htx: Use default reason if not set when formatting the response
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Nov 2024 13:31:21 +0000 (14:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Dec 2024 14:35:44 +0000 (15:35 +0100)
commit736d4e2c3550dc9c56e5f05778457466b3ce13d9
tree80002f457daca7ffd3fe0f69ede1c32e9435013a
parentd0129d2c2a408a9dabd486ee129f3ec8b0199270
BUG/MINOR: h1-htx: Use default reason if not set when formatting the response

When the response status line is formatted before sending it to the client,
if there is no reason set, HAProxy should add one that matches the status
code, as stated in the configuration manual. However it is not performed.

It is possible to hit this bug when the response comes from a H2 server,
because there is no reason field in HTTP/2 and above.

This patch should fix the issue #2798. It should be backported to all stable
versions.

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