vtest "Test POST->GET conversion"

server s1 {
	rxreq
	txresp \
		-hdr "Connection: close" \
		-body "012345\n"
} -start

vinyl v1 -vcl+backend {
	sub vcl_recv {
		if (req.method == "POST") {
			set req.method = "GET";
		}
	}
} -start

client c1 {
	txreq -req POST -url "/" \
		-body "123456789\n"
	rxresp
	expect resp.status == 200
	expect resp.http.X-Vinyl == "1001"

	txreq -req POST -url "/" \
		-body "123456789\n"
	rxresp
	expect resp.status == 200
	expect resp.http.X-Vinyl == "1003 1002"
}

client c1 -run
