vtest "C-L/T-E:chunked conflict"

server s1 {
	non_fatal
	rxreq
	expect req.bodylen == 20

	send "HTTP/1.1 200 OK\r\n"
	send "Content-Length: 31\r\n"
	send "Transfer-Encoding: chunked\r\n"
	send "\r\n"
	send "14\r\n"
	send "0123456789"
	send "0123456789\n"
	send "0\r\n"
	send "\r\n"

} -start

vinyl v1 -vcl+backend { } -start

client c1 {

	non_fatal
	send "PUT /1 HTTP/1.1\r\n"
	send "Host: foo\r\n"
	send "Content-Length: 31\r\n"
	send "Transfer-Encoding: chunked\r\n"
	send "\r\n"
	send "14\r\n"
	send "0123456789"
	send "0123456789\n"
	send "0\r\n"
	send "\r\n"

	rxresp
	expect resp.status == 400
} -run

client c1 {
	fatal
	send "PUT /2 HTTP/1.1\r\n"
	send "Host: foo\r\n"
	send "Transfer-Encoding: chunked\r\n"
	send "\r\n"
	send "14\r\n"
	send "0123456789"
	send "0123456789\n"
	send "0\r\n"
	send "\r\n"

	rxresp
	expect resp.status == 503

} -run
