[Varnish] #1614: Missing support for pcre in substitution string
Varnish
varnish-bugs at varnish-cache.org
Tue Oct 21 00:38:29 CEST 2014
#1614: Missing support for pcre in substitution string
--------------------+----------------------
Reporter: anders | Type: defect
Status: new | Priority: normal
Milestone: | Component: varnishd
Version: 3.0.5 | Severity: normal
Keywords: pcre |
--------------------+----------------------
It seems Varnish fails to evaluate PCRE escapes in the substitution
string. For example if I want to insert odd characters using a hex escape.
Using Perl from CLI it works (but is displayed oddly as I have a UTF-8
terminal):
anders at noname:~$ echo hei | perl -p -e "s@^@\x{e5}@"
?hei
Consider the following VCL:
std.log("DEBUG: url is: " + req.url);
set req.url = regsub(req.url, "^", "/f\x{e5}");
std.log("DEBUG: url is now: " + req.url);
Then I get:
854 VCL_Log c DEBUG: url is: /
854 VCL_Log c DEBUG: url is now: /fx{e5}/
According to http://www.pcre.org/pcre.txt it should work:
\x{hhh..} character with hex code hhh.. (non-JavaScript mode)
This is what I need to do when the backend has an odd character in its
urls. :-)
--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1614>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list