vtest "RFC 9110 compliance"

server s1 {
	rxreq
	txresp -gzipbody "FOOOOOOBAR"
} -start

vinyl v1 -vcl+backend { } -start

logexpect l1 -v v1 -g raw {
	expect * 1004	BogoHeader	"Illegal char 0x20 in header name"
} -start

logexpect l2 -v v1 -g raw {
	expect * 1006	BogoHeader	"Illegal char 0x2f in header name"
} -start

client c1 {
	send "GET / HTTP/1.1\r\n"
	send "Host: foo\r\n"
	send "\r\n"
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 10

	send "GET / HTTP/1.1\r\n"
	send "Host: foo\r\n"
	send "Accept-Encoding: gzip\r\n"
	send "\r\n"
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 33

	send "GET / HTTP/1.1\r\n"
	send "Host: foo\r\n"
	send "Accept-Encoding : gzip\r\n"
	send "\r\n"
	rxresp
	expect resp.status == 400
} -run

client c1 {
	send "GET / HTTP/1.1\r\n"
	send "Host: foo\r\n"
	send "Accept/Encoding: gzip\r\n"
	send "\r\n"
	rxresp
	expect resp.status == 400
} -run

logexpect l1 -wait
logexpect l2 -wait
