]> git.kaiwu.me - haproxy.git/commit
REGTESTS: http-messaging: add tests for the H1 trailers
authorWilly Tarreau <w@1wt.eu>
Wed, 9 Sep 2026 07:11:01 +0000 (09:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 Sep 2026 08:08:12 +0000 (10:08 +0200)
commitb4298addef648c0c228e3a6f0915387f1b6aa05a
tree636e4d863710e3b56af516cb4f6f5088648997da
parent3358ca07144d3ec7bb722abc3b55cd4b631d9098
REGTESTS: http-messaging: add tests for the H1 trailers

The Transfer-Encoding test is extended to cover the HTTP/1 trailers,
both on the request and on the response path.

Valid trailers are checked to be forwarded in both directions. vtest is
not able to parse HTTP/1 trailers (it stops on the CRLF following the
last chunk), so they are read using "recv" and only the number of bytes
emitted by haproxy is verified. This is sufficient to prove that the
spaces surrounding the values were trimmed, since it changes the length,
and a second trailer-less message is exchanged over the same connection
to make sure nothing was emitted after the trailers.

The trailers rejected by the H1 parser are checked to result in a 400 on
the request path and in a 502 on the response path: invalid token in the
field name, missing colon, pseudo-header, empty field name and a CR not
followed by an LF in the value. Note that each message must be emitted
at once, otherwise haproxy has already forwarded the beginning of the
message when the invalid trailers are parsed and can only abort the
stream instead of responding with an error.
reg-tests/http-messaging/http_transfer_encoding.vtc