anchor.diff:  		resp_state=RespState, resp_headers=RespHeaders})
   		when RespState =:= waiting; RespState =:= waiting_stream ->
   	RespConn = response_connection(Headers, Connection),
  -	HTTP11Headers = if
  +	StdHeaders = if
  +		Version =:= 'HTTP/1.0', Connection =:= keepalive ->
  +			[{<<"connection">>, atom_to_connection(Connection)}];
   		Version =:= 'HTTP/1.0' -> [];
   		true ->
   			MaybeTE = if
   				RespState =:= waiting_stream -> [];
   				true -> [{<<"transfer-encoding">>, <<"chunked">>}]
   			end,
  -			[{<<"connection">>, atom_to_connection(Connection)}|MaybeTE]
  +			if
  +				Connection =:= close ->
  +					[{<<"connection">>, atom_to_connection(Connection)}|MaybeTE];
  +				true ->
  +					MaybeTE
  +			end
   	end,
   	RespState2 = if
   		Version =:= 'HTTP/1.1', RespState =:= 'waiting' -> chunks;
  
positive.code: 							{<<"content-encoding">>, <<"gzip">>},
  							{<<"date">>, cowboy_clock:rfc1123()},
  							{<<"server">>, <<"Cowboy">>}
  						|HTTP11Headers],
  						case Method of <<"HEAD">> -> <<>>; _ -> GzBody end,
  						Req),
  					Req2;
  				false ->
  					reply_no_compress(Status, Headers, Body, Req,
  						RespHeaders, HTTP11Headers, Method, BodySize)
  			end
  	catch _:_ ->
  		reply_no_compress(Status, Headers, Body, Req,
  			RespHeaders, HTTP11Headers, Method, BodySize)
  	end.
  
  reply_no_compress(Status, Headers, Body, Req,
  		RespHeaders, HTTP11Headers, Method, BodySize) ->
  	{_, Req2} = response(Status, Headers, RespHeaders, [
  			{<<"content-length">>, integer_to_list(BodySize)},
  			{<<"date">>, cowboy_clock:rfc1123()},
  			{<<"server">>, <<"Cowboy">>}
  		|HTTP11Headers],
  		case Method of <<"HEAD">> -> <<>>; _ -> Body end,
  		Req),
  	Req2.
  
negative.code: 					{<<"content-length">>, integer_to_list(ContentLength)},
  					{<<"date">>, cowboy_clock:rfc1123()},
  					{<<"server">>, <<"Cowboy">>}
  				|StdHeaders], stream, Req),
  			if	RespType =/= hook, Method =/= <<"HEAD">> ->
  					BodyFun(Socket, Transport);
  				true -> ok
  