Refactor vtc: extract to own sub

parent 4bb36728
......@@ -28,11 +28,7 @@ varnish v1 -vcl+backend {
sub vcl_recv {
return (synth(200));
}
sub vcl_synth {
set resp.http.fail = p_test.parse(req.http.not);
set resp.http.parse =
p_test.parse({"{ a: 1, b: "hi there", c: true, d: false, "} +
{" e : null, f: [ 1, -2, 3], g: { "1": [], h: [ 7 ] } } "});
sub extract {
set resp.http.a = p_test.extract(".a");
set resp.http.a-type = p_test.type(".a");
......@@ -68,6 +64,13 @@ varnish v1 -vcl+backend {
set resp.http.g = p_test.extract(".g");
set resp.http.g-type = p_test.type(".g");
}
sub vcl_synth {
set resp.http.fail = p_test.parse(req.http.not);
set resp.http.parse =
p_test.parse({"{ a: 1, b: "hi there", c: true, d: false, "} +
{" e : null, f: [ 1, -2, 3], g: { "1": [], h: [ 7 ] } } "});
call extract;
}
} -start
client c1 {
......
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