[Varnish] #913: Regsub on unset header doesn't work, but autovivifies
Varnish
varnish-bugs at varnish-cache.org
Mon May 16 12:40:04 CEST 2011
#913: Regsub on unset header doesn't work, but autovivifies
-------------------+--------------------------------------------------------
Reporter: jib | Type: defect
Status: new | Priority: normal
Milestone: | Component: build
Version: 2.1.5 | Severity: normal
Keywords: |
-------------------+--------------------------------------------------------
Description changed by phk:
Old description:
> If the behaviour is undefined currently, I'd suggest making it autovivify
> on first use,
> meaing that X-Test-OneLine would hold '1 2' with a patch.
>
> Also broken in git HEAD at revision:
> ~/sources/git/varnish-cache$ git log | head -1
> commit f830854cdbaf40870d810d35d1cd6667352f0daa
>
> $ dpkg -l | grep varnish
> ii libvarnish1 2.1.5-1~lucid4
> shared libraries for Varnish
> ii varnish 2.1.5-1~lucid4 a
> state-of-the-art, high-performance HTTP ac
>
> ====================================================
>
> sub vcl_deliver {
> remove resp.http.X-Test-OneLine;
> remove resp.http.X-Test-TwoLine;
> set resp.http.X-Test-OneLine = regsub( resp.http.X-Test-OneLine, "$",
> "1 2" );
> set resp.http.X-Test-TwoLine = regsub( resp.http.X-Test-OneLine, "$",
> "1" );
> set resp.http.X-Test-TwoLine = regsub( resp.http.X-Test-OneLine, "$",
> "2" );
> }
>
> $ curl -Is http://localhost:6081/ | grep X-Test
> X-Test-OneLine:
> X-Test-TwoLine: 2
New description:
If the behaviour is undefined currently, I'd suggest making it autovivify
on first use,
meaing that X-Test-OneLine would hold '1 2' with a patch.
Also broken in git HEAD at revision:
~/sources/git/varnish-cache$ git log | head -1
commit f830854cdbaf40870d810d35d1cd6667352f0daa
{{{
$ dpkg -l | grep varnish
ii libvarnish1 2.1.5-1~lucid4
shared libraries for Varnish
ii varnish 2.1.5-1~lucid4 a
state-of-the-art, high-performance HTTP ac
====================================================
sub vcl_deliver {
remove resp.http.X-Test-OneLine;
remove resp.http.X-Test-TwoLine;
set resp.http.X-Test-OneLine = regsub( resp.http.X-Test-OneLine, "$",
"1 2" );
set resp.http.X-Test-TwoLine = regsub( resp.http.X-Test-OneLine, "$",
"1" );
set resp.http.X-Test-TwoLine = regsub( resp.http.X-Test-OneLine, "$",
"2" );
}
$ curl -Is http://localhost:6081/ | grep X-Test
X-Test-OneLine:
X-Test-TwoLine: 2
}}}
--
--
Ticket URL: <http://www.varnish-cache.org/trac/ticket/913#comment:1>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list