]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Fix test to skip trailers from chunked messages
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 22 Apr 2026 15:24:56 +0000 (17:24 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Apr 2026 08:49:10 +0000 (10:49 +0200)
The test to remove trailers from chunked messages was inverted and is thus
ineffective. The flag for the requests was tested on client side and the flag
for the response was tested on server side. It should be the opposite.

This patch must be backported as far as 3.2.

src/mux_h1.c

index b05ddcc9acb9f076ef793caa6c69503ff106b37a..527d3495f0cf5bad8123acd6bf128242fa9ec6ae 100644 (file)
@@ -3471,8 +3471,8 @@ static size_t h1_make_trailers(struct h1s *h1s, struct h1m *h1m, struct htx *htx
                                goto nextblk;
 
                        /* Skip the trailers because the corresponding conf option was set */
-                       if ((!(h1m->flags & H1_MF_RESP) && (h1c->px->options & PR_O_HTTP_DROP_RES_TRLS)) ||
-                           ((h1m->flags & H1_MF_RESP) && (h1c->px->options & PR_O_HTTP_DROP_REQ_TRLS)))
+                       if ((!(h1m->flags & H1_MF_RESP) && (h1c->px->options & PR_O_HTTP_DROP_REQ_TRLS)) ||
+                           ((h1m->flags & H1_MF_RESP) && (h1c->px->options & PR_O_HTTP_DROP_RES_TRLS)))
                                goto nextblk;
 
                        n = htx_get_blk_name(htx, blk);