]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: compression/htx: Don't compress responses with unknown body length
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 21 Dec 2018 13:53:54 +0000 (14:53 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 21 Dec 2018 14:33:16 +0000 (15:33 +0100)
In HTX, if the body length of a response cannot be determined, we must not try
to compress it.

src/flt_http_comp.c

index ddcdce614f6184900cea1f566e23afc68d75315d..ce0dba17c0a6212ade39781aae855c96dde8b004 100644 (file)
@@ -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 */