When changing purge->ban in 3.0, should we also expose the VRT_ban_string functionality from VCL instead of relying on magic parsing the difference

Tollef Fog Heen tfheen at varnish-software.com
Fri Apr 29 12:32:50 CEST 2011


]] "Poul-Henning Kamp" 

| In message <8762pxfyhi.fsf at qurzaw.varnish-software.com>, Tollef Fog Heen writes
| :
| >| I'm sort of hessitant to mandate the one-string format, because it
| >| will force some people to collect into one string, components which
| >| the BAN code will immediately split back into those components.
| >
| >Apart from the slight silliness and inelegance of this, does it cause
| >any real-world problems?
| 
| I worry about quoting madness...

It'd be less quoting madness by not trying to do magic in the ban
parser:

ban("req.url == " + req.url);

looks a whole lot more sane than:

ban("req.url == req.url"); 

where then req.url doesn't mean the same thing on the left and right
hand sides.

(Unless I've misunderstood something about what the current code does).

Or are you worried about the case of req.url (or whatever you ban on)
containing &&, || and similar characters?  Can we solve that by having a
function which escapes anything special to bans, so we can do:

ban("req.url == " + ban_escape(req.url));

?

Cheers,
-- 
Tollef Fog Heen
Varnish Software
t: +47 21 98 92 64




More information about the varnish-dev mailing list