vtest "ESI:include with https"

server s1 {
	rxreq
	expect req.url == "/"
	txresp -body {
		<html>
		Before include
		<!--esi <esi:include src="https://bozz/body"/> -->
		After include
	}

	rxreq
	expect req.url == "/foo"
	txresp -body {
		<html>
		Before include
		<!--esi <esi:include src="https://bozz/body"/> -->
		After include
	}
	rxreq
	expect req.url == "/body"
	expect req.http.host == "bozz"
	txresp -body BAR

} -start

vinyl v1 -vcl+backend {
	sub vcl_backend_response {
		set beresp.do_esi = true;
	}
} -start

client c1 {
	txreq
	rxresp
	expect resp.bodylen == 49
} -run

vinyl v1 -cliok "param.set feature +esi_ignore_https"

client c1 {
	txreq -url /foo
	rxresp
	expect resp.bodylen == 52
} -run
