anchor.diff:  %A server can send more than one response per request only when a
   %1xx response is sent preceding the final response. (RFC7230 5.6)
   %
  -%@todo
  -%A server that does parallel pipelining must send responses in the
  -%same order as the requests came in. (RFC7230 5.6)
  -%
   %```
   %HTTP-response = status-line *( header-field CRLF ) CRLF [ message-body ]
   %```
  
positive.code: %The requests can be processed in parallel if they all have safe methods.
  
  %@todo
  %The server must reject abusive traffic by closing the connection.
  %Abusive traffic can come from the form of too many requests in a
  %given amount of time, or too many concurrent connections. Limits
  
negative.code: %
  %The message body is the octets after decoding any transfer
  %codings. (RFC7230 3.3)
  
  content_length_0_when_no_body(Config) ->
  	doc("When the length is known in advance, the server must send a "
  		"content-length header, including if the length is 0. (RFC7230 3.3.2, RFC7230 3.3.3)"),
  	#{code := 200, headers := RespHeaders} = do_raw(Config, [
  		"GET /resp/reply2/200 HTTP/1.1\r\n"
  		"Host: localhost\r\n"
  		"\r\n"]),
  	{_, <<"0">>} = lists:keyfind(<<"content-length">>, 1, RespHeaders),
  	ok.
  
  content_length_response(Config) ->
  	doc("When the length is known in advance, the server must send a "
  		"content-length header. (RFC7230 3.3.2, RFC7230 3.3.3)"),
  	#{code := 200, headers := RespHeaders} = do_raw(Config, [
  		"GET / HTTP/1.1\r\n"
  		"Host: localhost\r\n"
  		"\r\n"]),
  	{_, <<"12">>} = lists:keyfind(<<"content-length">>, 1, RespHeaders),
  	ok.
  
  chunked_response(Config) ->
  	doc("When the length is not known in advance, the chunked transfer-encoding "
  		"must be used. (RFC7230 3.3.2, RFC7230 3.3.3)"),
  	#{code := 200, headers := RespHeaders} = do_raw(Config, [
  		"GET /resp/stream_reply2/200 HTTP/1.1\r\n"
  		"Host: localhost\r\n"
  		"\r\n"]),
  	{_, <<"chunked">>} = lists:keyfind(<<"transfer-encoding">>, 1, RespHeaders),
  	%% @todo We probably want to check the body received too.
  	ok.
  
  %compat_no_content_length_or_transfer_encoding_close_on_body_end(Config) ->
  %For compatibility purposes a server can send no content-length or
  %transfer-encoding header. In this case the connection must be
  %closed after the response has been sent fully. (RFC7230 3.3.2, RFC7230 3.3.3)
  
  no_content_length_if_transfer_encoding(Config) ->
  	doc("The content-length header must not be sent when a transfer-encoding "
  		"header already exists. (RFC7230 3.3.2)"),
  	#{code := 200, headers := RespHeaders} = do_raw(Config, [
  		"GET /resp/stream_reply2/200 HTTP/1.1\r\n"
  		"Host: localhost\r\n"
  		"\r\n"]),
  	false = lists:keyfind(<<"content-length">>, 1, RespHeaders),
  	ok.
  
  %@todo
  %The server must not apply the chunked transfer-encoding more than
  %once. (RFC7230 3.3.1)
  %
  %@todo
  %The server must apply the chunked transfer-encoding last. (RFC7230 3.3.1)
  
  http10_request_no_transfer_encoding_in_response(Config) ->
  	doc("The transfer-encoding header must not be sent in responses to "
  		"HTTP/1.0 requests, or in responses that use the HTTP/1.0 version. "
  		"No transfer codings must be applied in these cases. (RFC7230 3.3.1)"),
  	Client = raw_open(Config),
  	ok = raw_send(Client, [
  		"GET /resp/stream_reply2/200 HTTP/1.0\r\n"
  		"Host: localhost\r\n"
  		"\r\n"]),
  	{_, 200, _, Rest} = cow_http:parse_status_line(raw_recv_head(Client)),
  	{RespHeaders, Rest2} = cow_http:parse_headers(Rest),
  	false = lists:keyfind(<<"content-length">>, 1, RespHeaders),
  	false = lists:keyfind(<<"transfer-encoding">>, 1, RespHeaders),
  	Body = <<0:8000000>>,
  	{ok, Body} = raw_recv(Client, byte_size(Body), 5000),
  	%% The end of body is indicated by a connection close.
  	{error, timeout} = raw_recv(Client, 0, 1000),
  	ok.
  
  %```
  %TE = #t-codings
  %
  