anchor.diff:  %% @doc Send a reply to the client.
   -spec reply(cowboy_http:status(), cowboy_http:headers(), iodata(), #http_req{})
   	-> {ok, #http_req{}}.
  -reply(Status, Headers, Body, Req=#http_req{socket=Socket,
  -		transport=Transport, connection=Connection, pid=ReqPid,
  +reply(Status, Headers, Body, Req=#http_req{socket=Socket, transport=Transport,
  +		version=Version, connection=Connection, pid=ReqPid,
   		method=Method, resp_state=waiting, resp_headers=RespHeaders}) ->
   	RespConn = response_connection(Headers, Connection),
   	ContentLen = case Body of {CL, _} -> CL; _ -> iolist_size(Body) end,
  -	Head = response_head(Status, Headers, RespHeaders, [
  -		{<<"Connection">>, atom_to_connection(Connection)},
  +	HTTP11Headers = case Version of
  +		{1, 1} -> [{<<"Connection">>, atom_to_connection(Connection)}];
  +		_ -> []
  +	end,
  +	response(Status, Headers, RespHeaders,  [
   		{<<"Content-Length">>, integer_to_list(ContentLen)},
   		{<<"Date">>, cowboy_clock:rfc1123()},
   		{<<"Server">>, <<"Cowboy">>}
  -	]),
  +	|HTTP11Headers], Req),
   	case {Method, Body} of
  -		{'HEAD', _} -> Transport:send(Socket, Head);
  -		{_, {_, StreamFun}} -> Transport:send(Socket, Head), StreamFun();
  -		{_, _} -> Transport:send(Socket, [Head, Body])
  +		{'HEAD', _} -> ok;
  +		{_, {_, StreamFun}} -> StreamFun();
  +		{_, _} -> Transport:send(Socket, Body)
   	end,
   	ReqPid ! {?MODULE, resp_sent},
   	{ok, Req#http_req{connection=RespConn, resp_state=done,
  
positive.code: %% @see cowboy_http_req:chunk/2
  -spec chunked_reply(cowboy_http:status(), cowboy_http:headers(), #http_req{})
  	-> {ok, #http_req{}}.
  chunked_reply(Status, Headers, Req=#http_req{socket=Socket,
  		transport=Transport, version=Version, connection=Connection,
  		pid=ReqPid, resp_state=waiting, resp_headers=RespHeaders}) ->
  	RespConn = response_connection(Headers, Connection),
  	DefaultHeaders = [
  		{<<"Date">>, cowboy_clock:rfc1123()},
  		{<<"Server">>, <<"Cowboy">>}
  	],
  	DefaultHeaders2 = case Version of
  		{1, 1} -> [
  				{<<"Connection">>, atom_to_connection(Connection)},
  				{<<"Transfer-Encoding">>, <<"chunked">>}
  			] ++ DefaultHeaders;
  		_ -> DefaultHeaders
  	end,
  	Head = response_head(Status, Headers, RespHeaders, DefaultHeaders2),
  	Transport:send(Socket, Head),
  	ReqPid ! {?MODULE, resp_sent},
  	{ok, Req#http_req{connection=RespConn, resp_state=chunks,
  		resp_headers=[], resp_body= <<>>}}.
  
negative.code: set_resp_body_fun(StreamLen, StreamFun, Req) ->
  	{ok, Req#http_req{resp_body={StreamLen, StreamFun}}}.
  
  %% @doc Return whether the given header has been set for the response.
  -spec has_resp_header(cowboy_http:header(), #http_req{}) -> boolean().
  has_resp_header(Name, #http_req{resp_headers=RespHeaders}) ->
  