anchor.diff:      {500, error, Error}.
   
   send_error(Req, {method_not_allowed, Methods}) ->
  -    {ok, Req:respond({405, [{"Allow", Methods}], <<>>})};
  +    {ok, Req:respond({405, [{"Allow", Methods}] ++ server_header(), <<>>})};
   send_error(Req, {modified, Etag}) ->
  -    {ok, Req:respond({412, [{"Etag", Etag}], <<>>})};
  +    {ok, Req:respond({412, [{"Etag", Etag}] ++ server_header(), <<>>})};
   send_error(Req, {not_modified, Etag}) ->
  -    {ok, Req:respond({304, [{"Etag", Etag}], <<>>})};
  +    {ok, Req:respond({304, [{"Etag", Etag}] ++ server_header(), <<>>})};
   send_error(Req, Error) ->
       {Code, Json} = error_to_json(Error),
       ?LOG_INFO("HTTP Error (code ~w): ~p", [Code, Error]),
  
positive.code:     send_json(Req, Code, [], Value).
  
  send_json(Req, Code, Headers, Value) ->
      ContentType = negotiate_content_type(Req),
      Body = cjson:encode(Value),
      Resp = Req:respond({Code, [{"Content-Type", ContentType}] ++ Headers,
                          Body}),
      {ok, Resp}.
  
  start_json_response(Req, Code) ->
      start_json_response(Req, Code, []).
  
  start_json_response(Req, Code, Headers) ->
      ContentType = negotiate_content_type(Req),
      Req:respond({Code, [{"Content-Type", ContentType}] ++ Headers, chunked}).
  
  end_json_response(Resp) ->
      Resp:write_chunk(""),
  
negative.code:         true  -> "application/json";
          false -> "text/plain;charset=utf-8"
      end.
  
  server_header() ->
      [{"Server", "CouchDB/" ++ couch_server:get_version() ++
                  " (Erlang OTP/" ++ erlang:system_info(otp_release) ++ ")"}].
  