From: Olivier Houchard Date: Wed, 2 Dec 2026 14:28:49 +0000 (+0100) Subject: BUG/MEDIUM: flt-decomp: skip responses without a transfer length X-Git-Tag: v3.5.0~8 X-Git-Url: https://git.kaiwu.me/http/%22..//%22%22)?a=commitdiff_plain;h=e186c08fbcc741e214ff0d0d9cd4f2763e418597;p=haproxy.git BUG/MEDIUM: flt-decomp: skip responses without a transfer length When a compressed response has neither a content-length nor a chunked encoding, its end is only known when the server closes. In this case, http_response_forward_body() ends the message as soon as the close is reported and the filter is not called anymore, so the decompressed data it could not emit yet were lost. The response was silently truncated, e.g. 998006 bytes delivered out of 1MB, with nothing reported to the client nor in the logs. Let's not decompress such messages, like the compression filter already does. They are forwarded untouched, with their content-encoding header, including in "always" mode. The filter was introduced in 3.5-dev6, so no backport is needed. --- diff --git a/src/flt_decomp.c b/src/flt_decomp.c index 5603f6155..3fe8d51b8 100644 --- a/src/flt_decomp.c +++ b/src/flt_decomp.c @@ -496,6 +496,10 @@ static int decomp_strm_http_headers(struct stream *s, struct filter *f, struct h if (msg->flags & HTTP_MSGF_BODYLESS) goto no_decomp; + /* the end of the payload is unknown without a transfer length */ + if (!(msg->flags & HTTP_MSGF_XFER_LEN)) + goto no_decomp; + if (msg->chn->flags & CF_ISRESP) { struct http_txn *txn = s->txn.http;