Skip to content

Commit

Permalink
Strip query string before testing which urls to strip cookies on
Browse files Browse the repository at this point in the history
  • Loading branch information
instification committed Aug 29, 2017
1 parent 4e7a50c commit 18c692f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
2.0a8 (unreleased)
------------------

- Nothing changed yet.
- Stripped query string before testing which urls to strip cookies on.
https://github.com/collective/plone.recipe.varnish/issues/42 [instification]


2.0a7 (2017-08-16)
Expand Down
3 changes: 2 additions & 1 deletion plone/recipe/varnish/templates/varnish4.vcl.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ sub vcl_recv {
/* cookies for pass */
{% for rule in cookiepass %}
{# this part need review #}
set req.http.UrlNoQs = regsub(req.url, "\?.*$", "");
if (req.http.Cookie && req.http.Cookie ~ "{{rule['match']}}") {
if (req.url ~ "{{rule['exclude']}}") {
if (req.http.UrlNoQs ~ "{{rule['exclude']}}") {
unset req.http.cookie;
return(pipe);
}
Expand Down

0 comments on commit 18c692f

Please sign in to comment.