Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
ab26b0b4
Commit
ab26b0b4
authored
Apr 05, 2023
by
Lachie
Committed by
Dridi Boukelmoune
Oct 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bereq: Also unset a cached req body
parent
7bf4d5be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+6
-0
v00068.vtc
bin/varnishtest/tests/v00068.vtc
+33
-0
No files found.
bin/varnishd/cache/cache_vrt_var.c
View file @
ab26b0b4
...
...
@@ -35,6 +35,7 @@
#include <stdio.h>
#include "cache_varnishd.h"
#include "cache_objhead.h"
#include "cache_transport.h"
#include "common/heritage.h"
...
...
@@ -595,6 +596,11 @@ VRT_u_bereq_body(VRT_CTX)
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
bo
,
BUSYOBJ_MAGIC
);
if
(
ctx
->
bo
->
bereq_body
!=
NULL
)
{
HSH_DerefObjCore
(
ctx
->
bo
->
wrk
,
&
ctx
->
bo
->
bereq_body
,
0
);
http_Unset
(
ctx
->
bo
->
bereq
,
H_Content_Length
);
}
if
(
ctx
->
bo
->
req
!=
NULL
)
{
CHECK_OBJ
(
ctx
->
bo
->
req
,
REQ_MAGIC
);
ctx
->
bo
->
req
=
NULL
;
...
...
bin/varnishtest/tests/v00068.vtc
0 → 100644
View file @
ab26b0b4
varnishtest "unset bereq.body with cached req body"
server s1 {
rxreq
expect req.method == "GET"
expect req.http.Content-Length == <undef>
txresp
rxreq
expect req.method == "GET"
txresp
} -start
varnish v1 -vcl+backend {
import std;
sub vcl_recv {
std.cache_req_body(2KB);
}
sub vcl_backend_fetch {
unset bereq.body;
}
} -start
client c1 {
txreq -body "fine"
rxresp
expect resp.status == 200
txreq
rxresp
expect resp.status == 200
} -run
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment