[Varnish] #1218: String concatenation operator '+' doesn't work on empty strings
Varnish
varnish-bugs at varnish-cache.org
Thu Oct 18 23:19:18 CEST 2012
#1218: String concatenation operator '+' doesn't work on empty strings
-----------------------+----------------------
Reporter: jafcobend | Type: defect
Status: new | Priority: normal
Milestone: | Component: varnishd
Version: 3.0.3 | Severity: normal
Keywords: |
-----------------------+----------------------
I tried doing something like this in vcl_recv():
set req.http.Cookie = req.http.Cookie+" "+req.http.Cookie-sess;
I discovered that this only works if req.http.Cookie already has a value.
In my VCL it may or may not have a value by the time it gets here. I was
able to do this instead:
if(req.http.Cookie) {
set req.http.Cookie = req.http.Cookie+" "+req.http.Cookie-sess;
} else {
set req.http.Cookie = req.http.Cookie-sess;
}
But it sure would be nice if the first one-liner worked.
--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1218>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list