Skip to content

Commit

Permalink
Disallow x-varnish-token validation (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego García authored Mar 30, 2021
1 parent 3e3dfa3 commit 61f30f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions varnish/conf/default.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ sub vcl_recv {
unset req.http.forwarded;
# To allow API Platform to ban by cache tags
if (req.method == "BAN") {
if (req.http.x-varnish-token != std.getenv("VARNISH_PURGE_TOKEN")) {
return (synth(405, "Not allowed"));
}
# if (req.http.x-varnish-token != std.getenv("VARNISH_PURGE_TOKEN")) {
# return (synth(405, "Not allowed"));
# }
if (req.http.ApiPlatform-Ban-Regex) {
ban("obj.http.Cache-Tags ~ " + req.http.ApiPlatform-Ban-Regex);
return (synth(200, "Ban added"));
Expand Down

0 comments on commit 61f30f1

Please sign in to comment.