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.
This commit is contained in:
William Lallemand 2017-11-08 11:25:15 +01:00 committed by Willy Tarreau
parent 34650d5a7b
commit 18f133adb3

View File

@ -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;