Header set to NULL by a VMOD: semantic change between 3.0.3 and 3.0.6
Geoff Simmons
geoff at uplex.de
Mon Nov 3 16:24:50 CET 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 11/03/2014 04:02 PM, Carlos Abalde wrote:
>>
>> ... Should be replaced after 3.0.3 with something like:
>>
>> set req.http.x-foo = vmod.foo(); if (req.http.x-foo != "") { #
>> VMOD returned NULL. }
>
> Small correction:
>
> set req.http.x-foo = vmod.foo(); if (req.http.x-foo == "") { # VMOD
> returned NULL (or empty string) }
Carlos, thanks, I can confirm that for 3.0.6, and it's certainly a
better workaround than my idea with the regex.
But it should be pointed out that this is *also* a semantic difference
between 3.0.3 and 3.0.6:
# If the VMOD returns NULL ...
set req.http.x-foo = vmod.foo();
if (req.http.x-foo != "") {
# ... then this condition is true in 3.0.3, false in 3.0.6
}
That is, if a VMOD assigns NULL to a header, then the header is
evaluated as not equal to the empty string in 3.0.3, but equal to ""
in 3.0.6.
Best,
Geoff
- --
** * * UPLEX - Nils Goroll Systemoptimierung
Scheffelstraße 32
22301 Hamburg
Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753
http://uplex.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBCAAGBQJUV55CAAoJEOUwvh9pJNUR6HoQAIMw8QRnP5amDtVuZey3R2RL
Sv3uElmPrc/9GUHoiJnEx4LbOc5ekA0wKmBKz1sW36bS63FvK41zAfsqMstY7PbX
sqdkUmkRoZMEc/8Qd39OIAwlHNL5kIX/2aDalnicvM9vo6SvHSDO+sgyEs2xOjh8
ifM/xbcQvue+TBpCFwLlPmDAdOD2A/sF2kNzRJXP+beN5h7Mx5uoOD7NGzDLIyLX
P6lHqPTOwxbYHL80pfBX4jPkJYKLZrf7xgR3NxBe+dIPka+kcEKOOiD1ATXuR1Bz
zswC8eFvUPxRbMvQ+Pg7ndrP+yx6Zon+w0Hmk1aqDT3kpdJw9/zaN9Ib69S1+e6B
8+UDMy6Xu+15I9q9l/u97zUf8QdAKGq4wUTbZNs0w3u6xzEmBg4RwReyAhUhmPZK
r9nyKxVX5CJLt3Ge/K78Ps4c6pDR5P/e/3vTjxiAUC57xMAyYYsFhMni3zoRJ8DI
frhlLrSh8yLrJQzoDNgmr7XJH+T3EHqC6J6+WL0ZJm5XgmmnptZ5ksdtUtAQezx0
Mq5Nl9gifn2B1BNyJqjdXF+teb7k4GpQh043TZ3TLbujUFTF4Z4SCa5WBc0ZILEP
vv2ETj47dlDmxCf6xKymwuYLjS9E7x+0W4/WjYyfzmFf1eyZp77MYPZlFJwRHPkd
j6G/bNRtWR1IdKl8nP2x
=pVNK
-----END PGP SIGNATURE-----
More information about the varnish-misc
mailing list