anchor.diff:  -module(couch_httpd).
   -include("couch_db.hrl").
   
  --export([start_link/0, start_link/1, stop/0, config_change/2, 
  +-export([start_link/0, start_link/1, stop/0, config_change/2,
           handle_request/5]).
   
   -export([header_value/2,header_value/3,qs_value/2,qs_value/3,qs/1,qs_json_value/3]).
  
positive.code:     % allow broken HTTP clients to fake a full method vocabulary with an X-HTTP-METHOD-OVERRIDE header
      MethodOverride = MochiReq:get_primary_header_value("X-HTTP-Method-Override"),
      Method2 = case lists:member(MethodOverride, ["GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", "COPY"]) of
      true -> 
          ?LOG_INFO("MethodOverride: ~s (real method was ~s)", [MethodOverride, Method1]),
          case Method1 of
          'POST' -> couch_util:to_existing_atom(MethodOverride);
          _ -> 
              % Ignore X-HTTP-Method-Override when the original verb isn't POST.
              % I'd like to send a 406 error to the client, but that'd require a nasty refactor.
              % throw({not_acceptable, <<"X-HTTP-Method-Override may only be used with POST requests.">>})
  
negative.code:     % Fun({Length, Binary}, State)
      % called with Length == 0 on the last time.
      MochiReq:stream_body(MaxChunkSize, ChunkFun, InitState).
  
  body_length(Req) ->
      case header_value(Req, "Transfer-Encoding") of
          undefined ->
  