netgen / ezpublish-kernel

eZ Publish API and kernel. This is the heart of eZ Publish 5. This is a v2014.11 kernel, maintained for bugfixes by Netgen.
https://netgen.io
Other
8 stars 18 forks source link

Fix EZP-24854: http cache purge bans wrong/additional location ids #17

Closed emodric closed 8 years ago

emodric commented 8 years ago

JIRA: https://jira.ez.no/browse/EZP-24854

Problem

When issue http cache (varnish) purge requests, a regex is used with multiple location Ids. The problem is that the regex is matching all locations that contain the value, for example, banning location 2 will also ban 12, 20, 21.

vcl ref: ban("obj.http.X-Location-Id ~ " + req.http.X-Location-Id); https://github.com/ezsystems/ezplatform/blob/master/doc/varnish/vcl/varnish4.vcl#L116

Solution

Fix by making sure that location is one of the requested (starts/ends with provided value)

Original PR by @joaoinacio at https://github.com/ezsystems/ezpublish-kernel/pull/1427