Unverified Commit aba2e566 authored by Nils Goroll's avatar Nils Goroll

Fix .match_body() for cached bereq.body

parent 446a5900
......@@ -43,12 +43,16 @@ varnish v1 -vcl {
# 1d670e2f04a4ff13615c7e6a4ee800e4ba8ebaf2
sub vcl_recv {
# adjust if number of reqs in c1 changes
if (std.integer(req.xid) > 1009) {
if (std.integer(req.xid) >= 1020) {
std.cache_req_body(1KB);
}
# adjust if number of reqs in c1 changes
if (std.integer(req.xid) >= 1011) {
return (pass);
}
# adjust if number of reqs in c1 changes
if (std.integer(req.xid) > 1005) {
if (std.integer(req.xid) >= 1006) {
std.cache_req_body(1KB);
}
if (pattern.match_body(req_body)) {
......
/*-
* Copyright 2013 - 2018 UPLEX Nils Goroll Systemoptimierung
* Copyright 2013 - 2023 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Authors: Geoffrey Simmons <geoffrey.simmons@uplex.de>
......@@ -556,6 +556,11 @@ vmod_regex_match_body(VRT_CTX, struct vmod_re_regex *re, VCL_ENUM which,
(void) VRB_Iterate(ctx->req->wrk, ctx->vsl, ctx->req,
match_iter_f, reip);
}
else if (which == VENUM(bereq_body) &&
ctx->bo != NULL && ctx->bo->bereq_body != NULL) {
(void) ObjIterate(ctx->bo->wrk, ctx->bo->bereq_body,
reip, match_iter_f, 0);
}
else if (which == VENUM(bereq_body)) {
if (ctx->bo == NULL || ctx->bo->req == NULL)
errmsg(ctx, "vmod re: .match_body(which = bereq_body) "
......
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