percent sign in vcl strings

Camiel Dobbelaar cd at sentia.nl
Tue May 31 19:27:22 CEST 2011


It turns out to be pretty painful to try to match a URL that looks like
this:

http://hostname/%2fmedia%2f76525%2fcoverthumbnail.jpg

I spent quite some time in pcre manpages before stumbling on this thread:
http://comments.gmane.org/gmane.comp.web.varnish.misc/3604

The answer there is to use "%25" to match a literal "%", which means the
regex ends up looking this:

req.url ~ "^/%252fmedia%252f"


What about allowing "%%" for a literal "%" like printf() ?


--
Cam












More information about the varnish-misc mailing list