Cookie VMOD keep/filter documentation issue

Justin Lloyd justinl at arena.net
Tue Apr 6 17:41:29 UTC 2021


Forget I asked, that was a dumb question since it's a regex and | can be used. /sigh

Justin

________________________________
From: Justin Lloyd <justinl at arena.net>
Sent: Tuesday, April 6, 2021 10:35 AM
To: Dridi Boukelmoune <dridi at varni.sh>
Cc: varnish-misc at varnish-cache.org <varnish-misc at varnish-cache.org>
Subject: Re: Cookie VMOD keep/filter documentation issue

Hi Dridi,

Thanks for confirming that! However, is there then a way to get the effect of being able to pass a regex to keep_re() and filter_re()? I just started working with the cookie vmod this morning and this would be a useful feature. As I understand it, Varnish 6.4 (we're on 6.5) replaced filter() and filter_except() with keep() and keep_re() and that the previous functions could take CSV strings.

Thanks,
Justin

________________________________
From: Dridi Boukelmoune <dridi at varni.sh>
Sent: Tuesday, April 6, 2021 10:29 AM
To: Justin Lloyd <justinl at arena.net>
Cc: varnish-misc at varnish-cache.org <varnish-misc at varnish-cache.org>
Subject: Re: Cookie VMOD keep/filter documentation issue

On Tue, Apr 6, 2021 at 4:11 PM Justin Lloyd <justinl at arena.net> wrote:
>
> Hi all,
>
> I'm confused on whether cookie.keep_re and cookie.filter_re should work with CSV strings. The documentation at https://varnish-cache.org/docs/trunk/reference/vmod_cookie.html does not explicitly say that those two functions can take a CSV string like the docs for keep and filter do, but the example for keep_re uses such string, indicating that it should be able to. However, testing with varnishtest definitely shows that the _re functions do not work with CSV strings. Can anyone clarify what the truth is supposed to be?

Hi,

Looking at the examples right now it is clear [1] that filter() and
keep() each take a CSV string. It is also clear [1] that filter_re()
takes a single regular expression [2]. However, the keep_re()
example is both misleading and wrong.

Thanks for bringing this to our attention!

https://github.com/varnishcache/varnish-cache/commit/606977bbfb624ead38e9c8648beac0b3906a4294

Dridi

[1] to me
[2] not to be confused with a singular expression
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20210406/9c3a2ad5/attachment.html>


More information about the varnish-misc mailing list