vtest "Check that HEAD+pass returns Content-Length if backend provides it"

server s1 {
	rxreq
	expect req.method == "GET"
	txresp -bodylen 5
	rxreq
	expect req.method == "HEAD"
	txresp -nolen -hdr "Content-Length: 6"
} -start

vinyl v1 -vcl+backend {
	sub vcl_recv {
		if (req.url == "/2") {
			return (pass);
		}
	}
	sub vcl_backend_response {
		set beresp.do_stream = false;
	}
} -start

client c1 {
	txreq -req HEAD
	rxresp -no_obj
	expect resp.http.content-length == 5
} -run

client c1 {
	txreq -req HEAD -url /2
	rxresp -no_obj
	expect resp.http.content-length == 6
} -run
