anchor.diff:  %no_body_in_204_response(Config) ->
   %no_body_in_304_response(Config) ->
   %1xx, 204 and 304 responses never include a message body. (RFC7230 3.3)
  -%
  -%same_content_length_as_get_in_head_response(Config) ->
  -%same_transfer_encoding_as_get_in_head_response(Config) ->
  +
  +same_content_length_as_get_in_head_response(Config) ->
  +	doc("Responses to HEAD requests can include a content-length header. "
  +		"Its value must be the same as if the request was an unconditional "
  +		"GET. (RFC7230 3.3, RFC7230 3.3.1, RFC7230 3.3.2)"),
  +	Client = raw_open(Config),
  +	ok = raw_send(Client, [
  +		"HEAD / HTTP/1.1\r\n"
  +		"Host: localhost\r\n"
  +		"\r\n"]),
  +	{_, 200, _, Rest} = cow_http:parse_status_line(raw_recv_head(Client)),
  +	{Headers, <<>>} = cow_http:parse_headers(Rest),
  +	{_, <<"12">>} = lists:keyfind(<<"content-length">>, 1, Headers),
  +	ok.
  +
  +same_transfer_encoding_as_get_in_head_response(Config) ->
  +	doc("Responses to HEAD requests can include a transfer-encoding header. "
  +		"Its value must be the same as if the request was an unconditional "
  +		"GET. (RFC7230 3.3, RFC7230 3.3.1, RFC7230 3.3.2)"),
  +	Client = raw_open(Config),
  +	ok = raw_send(Client, [
  +		"HEAD /resp/stream_reply2/200 HTTP/1.1\r\n"
  +		"Host: localhost\r\n"
  +		"\r\n"]),
  +	{_, 200, _, Rest} = cow_http:parse_status_line(raw_recv_head(Client)),
  +	{Headers, <<>>} = cow_http:parse_headers(Rest),
  +	{_, <<"chunked">>} = lists:keyfind(<<"transfer-encoding">>, 1, Headers),
  +	ok.
  +
   %same_content_length_as_200_in_304_response(Config) ->
   %same_transfer_encoding_as_200_in_304_response(Config) ->
  -%Responses to HEAD requests and 304 responses can include a
  +%304 responses can include a
   %content-length or transfer-encoding header. Their value must
   %be the same as if the request was an unconditional GET. (RFC7230 3.3, RFC7230 3.3.1, RFC7230 3.3.2)
   %
  +%no_content_length_in_100_response(Config) ->
  +%no_content_length_in_101_response(Config) ->
  +%no_content_length_in_102_response(Config) ->
  +%1xx, 204 responses and "2xx responses to CONNECT requests" must
  +%not include a content-length or transfer-encoding header. (RFC7230 3.3.1, RFC7230 3.3.2)
  +
  +no_content_length_in_204_response(Config) ->
  +	doc("204 responses must not include a transfer-encoding header. "
  +		"(RFC7230 3.3.1, RFC7230 3.3.2)"),
  +	Client = raw_open(Config),
  +	ok = raw_send(Client, [
  +		"GET /resp/reply4/204 HTTP/1.1\r\n"
  +		"Host: localhost\r\n"
  +		"\r\n"]),
  +	{_, 204, _, Rest} = cow_http:parse_status_line(raw_recv_head(Client)),
  +	{Headers, <<>>} = cow_http:parse_headers(Rest),
  +	false = lists:keyfind(<<"content-length">>, 1, Headers),
  +	ok.
  +
  +%%% @todo CONNECT no_content_length_in_2xx_response_to_connect_request(Config) ->
   %no_transfer_encoding_in_100_response(Config) ->
   %no_transfer_encoding_in_101_response(Config) ->
   %no_transfer_encoding_in_102_response(Config) ->
  -%no_transfer_encoding_in_204_response(Config) ->
  -%%% @todo CONNECT no_transfer_encoding_in_2xx_response_to_connect_request(Config) ->
  -%no_content_length_in_100_response(Config) ->
  -%no_content_length_in_101_response(Config) ->
  -%no_content_length_in_102_response(Config) ->
  -%no_content_length_in_204_response(Config) ->
  -%%% @todo CONNECT no_content_length_in_2xx_response_to_connect_request(Config) ->
   %1xx, 204 responses and "2xx responses to CONNECT requests" must
   %not include a content-length or transfer-encoding header. (RFC7230 3.3.1, RFC7230 3.3.2)
  +
  +%% We only send transfer-encoding when streaming a response body.
  +%% We therefore need a streamed response in order to see a potential bug.
  +no_transfer_encoding_in_204_response(Config) ->
  +	doc("204 responses must not include a transfer-encoding header. "
  +		"(RFC7230 3.3.1, RFC7230 3.3.2)"),
  +	Client = raw_open(Config),
  +	ok = raw_send(Client, [
  +		"GET /resp/stream_reply2/204 HTTP/1.1\r\n"
  +		"Host: localhost\r\n"
  +		"\r\n"]),
  +	{_, 204, _, Rest} = cow_http:parse_status_line(raw_recv_head(Client)),
  +	{Headers, <<>>} = cow_http:parse_headers(Rest),
  +	false = lists:keyfind(<<"transfer-encoding">>, 1, Headers),
  +	ok.
  +
  +%%% @todo CONNECT no_transfer_encoding_in_2xx_response_to_connect_request(Config) ->
  +%1xx, 204 responses and "2xx responses to CONNECT requests" must
  +%not include a content-length or transfer-encoding header. (RFC7230 3.3.1, RFC7230 3.3.2)
   %
   %```
   %message-body = *OCTET
  
positive.code: %status-code   = 3DIGIT
  %reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  %```
  %
  %http10_request_http11_response(Config) ->
  %A server must send its own version. (RFC7230 2.6)
  %
  %@todo
  %An HTTP/1.1 server may send an HTTP/1.0 version for compatibility purposes. (RFC7230 2.6)
  %
  %@todo
  %RFC6585 defines additional status code a server can use to reject
  %messages. (RFC7230 9.3, RFC6585)
  %
  %%% Response headers.
  %
  %@todo
  %In responses, OWS must be generated as SP or not generated
  %at all. RWS must be generated as SP. BWS must not be
  
negative.code: 		{"/", hello_h, []},
  		{"/echo/:key[/:arg]", echo_h, []},
  		{"/length/echo/:key", echo_h, []},
  		{"/resp/:key[/:arg]", resp_h, []},
  		{"/send_message", send_message_h, []}
  %% @todo Something is clearly wrong about routing * right now.
  %%		{"*", asterisk_h, []}
  