File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -2,17 +2,41 @@ varnishtest "C-L with empty POST"
22
33server s1 {
44 rxreq
5+ expect req.method == "POST"
6+ txresp
7+ expect req.http.content-length == 0
8+
9+ rxreq
10+ expect req.method == "GET"
511 txresp
612 expect req.http.content-length == 0
713} -start
814
915varnish v1 -vcl+backend {
10-
16+ sub vcl_backend_error {
17+ if (bereq.method == "GETCL0") {
18+ return (retry);
19+ }
20+ }
21+ sub vcl_backend_fetch {
22+ # trick to get a GET with a C-L: 0
23+ if (bereq.retries == 0 && bereq.method == "GET") {
24+ set bereq.method = "GETCL0";
25+ return (error);
26+ }
27+ else if (bereq.method == "GETCL0") {
28+ set bereq.method = "GET";
29+ }
30+ return (fetch);
31+ }
1132} -start
1233
1334client c1 {
1435 txreq -method POST -hdr "content-length: 0"
1536 rxresp
37+
38+ txreq -method GET -hdr "content-length: 0"
39+ rxresp
1640} -run
1741
1842server s1 -wait
You can’t perform that action at this time.
0 commit comments