From c963eb2a1d654abb9837ca32b5fd26fcb7ad99b7 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 21 Dec 2018 14:53:54 +0100 Subject: [PATCH] BUG/MINOR: compression/htx: Don't compress responses with unknown body length In HTX, if the body length of a response cannot be determined, we must not try to compress it. --- src/flt_http_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index ddcdce614..ce0dba17c 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -914,7 +914,7 @@ htx_select_comp_reshdr(struct comp_state *st, struct stream *s, struct http_msg (txn->status != 203)) goto fail; - if (msg->flags & HTTP_MSGF_BODYLESS) + if (!(msg->flags & HTTP_MSGF_XFER_LEN) || msg->flags & HTTP_MSGF_BODYLESS) goto fail; /* content is already compressed */