Skip to content

Commit

Permalink
if we thought the request was auth'd based on the cookie, but the ETa…
Browse files Browse the repository at this point in the history
…g says it wasn't (first field is user), make sure we cache this as the anon variant. fixes caching of requests with malformed or invalid session cookies
  • Loading branch information
davisagli committed Oct 25, 2014
1 parent 9746985 commit b3f21f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plone_buildout/templates/default/default.vcl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ sub vcl_fetch {
set beresp.http.X-Varnish-Action = "FETCH (pass - not cacheable)";
return(hit_for_pass);
}
if (!req.http.X-Anonymous && beresp.http.ETag ~ "^|") {
set beresp.http.X-Varnish-Action = "FETCH (override - cache as anon)";
set req.http.X-Anonymous = "True";
}
return(deliver);
}

Expand Down

0 comments on commit b3f21f8

Please sign in to comment.