varnish / varnish-modules

Collection of Varnish Cache modules (vmods) by Varnish Software
Other
185 stars 86 forks source link

Add a `cookie.filter` function #55

Closed joshuaspence closed 7 years ago

joshuaspence commented 7 years ago

Fixes #23. Adds a cookie.filter function which is basically the oppositie of cookie.filter_except.

gquintard commented 7 years ago

Looks mostly good, I just have few remarks:

That's it for the nitpicking. However, is there a real use case for this?

joshuaspence commented 7 years ago

Thanks, that's good feedback. match_list is a much better name than greylist (variables names are always hard).

Yes, there is a real use case for this. We have Varnish configured to strip out a bunch of tracking cookies from all requests. This includes Google Analytics cookies and a few others that I can't remember off the top of my head. We currently strip these cookies out using a regular expression, but a cookie.filter function would make our VCL much cleaner.

gquintard commented 7 years ago

Very well, that's good to go in then.

I can either pull what you have now and polish myself, or let you have all the glory, as you prefer.

joshuaspence commented 7 years ago

Sure, I can finish it off.

gquintard commented 7 years ago

Merged, thanks!