Possible bug in std vmod, using backtrack and tolower, 4.0.2

T. Pascal t_pascal at zennet.com
Mon Nov 17 02:04:36 CET 2014


I am trying to lowercase the query parameters and encounter a very strange
non-lowercasing bug in std. Consider:

sub vcl_rec {
  set req.url = regsub(req.url,"([?].*)",std.tolower("\1"));
}

`curl 'http://localhost:8080/get?TEST=none'`
...

`varnishlog -d`
...
-   ReqMethod      GET
-   ReqURL         /get?TEST=none
-   ReqProtocol    HTTP/1.1
....
-   ReqHeader      Host: localhost:8080
-   VCL_call       RECV
-   ReqURL         /get?TEST=none
...

Not the expected lower case (should be /get?test=none)

Please note that the following works correctly:

sub vcl_rec {
  set req.url = regsub(req.url,"([?].*)",std.tolower("?TEST=none"));
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20141116/fbeb7042/attachment.html>


More information about the varnish-misc mailing list