Is varnish casting boolean to string? -
we have varnish 4.0.3 in live environment. extract code our vcl filein varnish vcl_recv:
set req.http.x-is-static-resource = true; #boolean assignment # code if (req.http.x-is-static-resource == true) { # boolean == boolean ? # code } but hits error:
message vcc-compiler: comparison of different types: string '==' bool ('/etc/varnish/utils.vcl' line 429 pos 37) if (req.http.x-is-static-resource == true) { ------------------------------------##-------- we found kind of assignments in several codes:
- https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl
- https://www.varnish-cache.org/trac/wiki/vclexamplehashalwaysmiss
i think varnish shouldn't hits error. assign boolean type , expect boolean type, right?
what missing?
thanks
the assignments found not req.http - req.http.[name] way access request header [name]. headers strings, not booleans. can still make work small changes, though:
set req.http.x-is-static-resource = "true"; [...] if (req.http.x-is-static-resource) { [...]
Comments
Post a Comment