vtest "Test cached request bodies can be piped"

server s1 {
	rxreq
	expect req.bodylen == 6
	expect req.http.foo == "true"
	txresp
} -start

vinyl v1 -vcl+backend {
	import std;

	sub vcl_recv {
		set req.http.foo = std.cache_req_body(10KB);
		return (pipe);
	}
} -start

client c1 {
	txreq -method POST -body "foobar"
	rxresp
	expect resp.status == 200
} -run

server s1 -wait
