varnishtest "Test that headers can be compared"

server s1 {
	rxreq
	expect req.url == "/foo"
	txresp -status 200 -body "1"
} -start

varnish v1 -vcl+backend {
	sub vcl_recv {
		if (req.http.etag == req.http.if-none-match) {
			return(synth(400,"FOO"));
		}
	}
} -start

client c1 {
	txreq -url "/foo"
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 1
	txreq -url "/foo" -hdr {etag: "foo"} -hdr {if-none-match: "foo"}
	rxresp
	expect resp.status == 400
} -run
