]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: h3: use the right option to drop the trailers on the backend side
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 3 Dec 2026 09:48:42 +0000 (10:48 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 3 Dec 2026 12:41:06 +0000 (13:41 +0100)
In h3_resp_trailers_send(), the trailers were dropped when the option
"http-drop-response-trailers" was set on the proxy, whatever the side. But
on the backend side, the request trailers are sent. So on a QUIC backend,
"http-drop-request-trailers" was ignored and the request trailers were
dropped if "http-drop-response-trailers" was set, for instance on a listen
section.

Now, like for the H2 mux, the option depending on the side is checked.

This patch must be backported to 3.3.

src/h3.c

index a7d37082790a708f8cb1dcc8c7b49c887e06793f..0f64487e1310f0114de0e905f6f2f4aafa09feb5 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -3108,8 +3108,12 @@ static int h3_resp_trailers_send(struct qcs *qcs, struct htx *htx, char *fin)
 
        hdr = 0;
 
-       /* Skip the trailers because the corresponding conf option was set */
-       if (qcs->qcc->proxy->options & PR_O_HTTP_DROP_RES_TRLS)
+       /* Skip the trailers because the corresponding conf option was set. On
+        * the frontend side, these are response trailers. On the backend side,
+        * these are request trailers.
+        */
+       if ((!(qcs->qcc->flags & QC_CF_IS_BACK) && (qcs->qcc->proxy->options & PR_O_HTTP_DROP_RES_TRLS)) ||
+           ((qcs->qcc->flags & QC_CF_IS_BACK) && (qcs->qcc->proxy->options & PR_O_HTTP_DROP_REQ_TRLS)))
                goto skip_trailers;
 
        for (blk = htx_get_head_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) {