From: William Lallemand Date: Wed, 8 Nov 2017 10:25:15 +0000 (+0100) Subject: BUG/MEDIUM: cache: does not cache if no Content-Length X-Git-Tag: v1.8-rc4~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18f133adb3b48ce730ea1c53a934fb1a7123b8c9;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: cache: does not cache if no Content-Length In the case of Transfer-Encoding: chunked, there is no Content-Length which causes the cache to allocate a too small shctx row for the data. It's not possible to allocate a shctx row for the chunks, we need to be able to allocate on-the-fly the shctx blocks during the data transfer. --- diff --git a/src/cache.c b/src/cache.c index 15e221012d..02bb0e048d 100644 --- a/src/cache.c +++ b/src/cache.c @@ -368,6 +368,10 @@ enum act_return http_action_store_cache(struct act_rule *rule, struct proxy *px, if (!(txn->req.flags & HTTP_MSGF_VER_11)) goto out; + /* does not cache if Content-Length unknown */ + if (!(msg->flags & HTTP_MSGF_CNT_LEN)) + goto out; + /* cache only GET method */ if (txn->meth != HTTP_METH_GET) goto out;