Avoid panic in VRT_CacheReqBody if called from outside vcl_recv {}

parent 3c6c0917
......@@ -973,12 +973,12 @@ VRT_CacheReqBody(VRT_CTX, VCL_BYTES maxsize)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
if (ctx->method != VCL_MET_RECV) {
VSLb(ctx->vsl, SLT_VCL_Error,
"req.body can only be cached in vcl_recv{}");
return (-1);
}
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
return (VRB_Cache(ctx->req, maxsize));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment