Commit d6127c3e authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Teach libvcc how to set HEADER += STRING_LIST;

And avoid the indentation of characters in vcc_assign_expr().

Fixes #3079
Closes #3100
parent 94e6e03e
varnishtest "set VCL_??? += VCL_STRING;"
server s1 {
rxreq
expect req.url == "/hello/world"
expect req.http.host == helloworld
txresp -hdr "x-powered-by: varnishtest"
} -start
varnish v1 -vcl+backend {
sub vcl_backend_fetch {
set bereq.url += "/world";
set bereq.http.host += "world";
}
sub vcl_backend_response {
set beresp.http.x-powered-by += bereq.http.x-varnish;
}
} -start
client c1 {
txreq -url "/hello" -hdr "host: hello"
rxresp
expect resp.status == 200
expect resp.http.x-powered-by == varnishtest1002
} -run
......@@ -82,6 +82,7 @@ static const struct assign {
{ DURATION, 0, DURATION },
{ STRING, T_INCR, STRING_LIST, "\v,\n" },
{ STRING, '=', STRING_LIST },
{ HEADER, T_INCR, STRING_LIST, "VRT_GetHdr(ctx, \v),\n" },
{ HEADER, '=', STRING_LIST },
{ BODY, '=', STRING_LIST },
{ VOID, '=', VOID }
......@@ -98,9 +99,9 @@ vcc_assign_expr(struct vcc *tl, struct symbol *sym, const struct assign *ap)
while (*e != '\0') {
if (*e == '\v')
Fb(tl, 1, "%s", sym->rname);
Fb(tl, 0, "%s", sym->rname);
else
Fb(tl, 1, "%c", *e);
Fb(tl, 0, "%c", *e);
e++;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment