Commit 5ecae908 authored by Nils Goroll's avatar Nils Goroll

stop using "purge" in the context of bans

parent f6abce43
...@@ -20,11 +20,11 @@ server s1 { ...@@ -20,11 +20,11 @@ server s1 {
varnish v1 -vcl+backend { varnish v1 -vcl+backend {
sub vcl_recv { sub vcl_recv {
if (req.method == "PURGE") { if (req.method == "BAN") {
ban ("req.url == " + req.url); ban ("req.url == " + req.url);
return (synth(410)); return (synth(410));
} }
if (req.method == "PURGESTR") { if (req.method == "BANSTR") {
ban ("" + req.http.ban); ban ("" + req.http.ban);
return (synth(410)); return (synth(410));
} }
...@@ -42,7 +42,7 @@ client c1 { ...@@ -42,7 +42,7 @@ client c1 {
# Ban: something else # Ban: something else
client c1 { client c1 {
txreq -req PURGE -url /foox txreq -req BAN -url /foox
rxresp rxresp
expect resp.status == 410 expect resp.status == 410
} -run } -run
...@@ -59,7 +59,7 @@ client c1 { ...@@ -59,7 +59,7 @@ client c1 {
# Ban: it # Ban: it
client c1 { client c1 {
txreq -req PURGE -url /foo txreq -req BAN -url /foo
rxresp rxresp
expect resp.status == 410 expect resp.status == 410
} -run } -run
...@@ -76,7 +76,7 @@ client c1 { ...@@ -76,7 +76,7 @@ client c1 {
# Ban: everything else # Ban: everything else
client c1 { client c1 {
txreq -req PURGESTR -hdr "ban: req.url != /foo" txreq -req BANSTR -hdr "ban: req.url != /foo"
rxresp rxresp
expect resp.status == 410 expect resp.status == 410
} -run } -run
...@@ -93,7 +93,7 @@ client c1 { ...@@ -93,7 +93,7 @@ client c1 {
# Ban: it # Ban: it
client c1 { client c1 {
txreq -req PURGESTR -hdr "Ban: obj.http.foo == bar6" txreq -req BANSTR -hdr "Ban: obj.http.foo == bar6"
rxresp rxresp
expect resp.status == 410 expect resp.status == 410
} -run } -run
...@@ -110,7 +110,7 @@ client c1 { ...@@ -110,7 +110,7 @@ client c1 {
# Ban: something else # Ban: something else
client c1 { client c1 {
txreq -req PURGESTR -hdr "Ban: obj.http.foo == bar6" txreq -req BANSTR -hdr "Ban: obj.http.foo == bar6"
rxresp rxresp
expect resp.status == 410 expect resp.status == 410
} -run } -run
...@@ -128,7 +128,7 @@ client c1 { ...@@ -128,7 +128,7 @@ client c1 {
# Header match # Header match
client c1 { client c1 {
txreq -req PURGESTR -hdr "Ban: req.http.foo == barcheck" txreq -req BANSTR -hdr "Ban: req.http.foo == barcheck"
rxresp rxresp
expect resp.status == 410 expect resp.status == 410
} -run } -run
...@@ -144,7 +144,7 @@ client c1 { ...@@ -144,7 +144,7 @@ client c1 {
# Header match # Header match
client c1 { client c1 {
txreq -req PURGESTR -hdr "Ban: obj.http.foo == barcheck" txreq -req BANSTR -hdr "Ban: obj.http.foo == barcheck"
rxresp rxresp
expect resp.status == 410 expect resp.status == 410
} -run } -run
......
...@@ -10,7 +10,7 @@ server s1 { ...@@ -10,7 +10,7 @@ server s1 {
varnish v1 -vcl+backend { varnish v1 -vcl+backend {
sub vcl_recv { sub vcl_recv {
if (req.method == "PURGE") { if (req.method == "BAN") {
ban(req.http.doesntexist); ban(req.http.doesntexist);
ban(""); ban("");
ban("req.url"); ban("req.url");
...@@ -43,7 +43,7 @@ logexpect l1 -v v1 -d 1 -g vxid { ...@@ -43,7 +43,7 @@ logexpect l1 -v v1 -d 1 -g vxid {
} -start } -start
client c1 { client c1 {
txreq -req "PURGE" txreq -req "BAN"
rxresp rxresp
expect resp.http.X-Varnish == "1004" expect resp.http.X-Varnish == "1004"
expect resp.status == 209 expect resp.status == 209
......
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