anchor.diff:      % put small token on heap to keep requests synced to backend calls
       erlang:put(nonce, couch_util:to_hex(crypto:rand_bytes(4))),
   
  -    {ok, Resp} =
  +    Result =
       try
           case authenticate_request(HttpReq, AuthenticationFuns) of
           #httpd{} = Req ->
  
positive.code:     end,
  
      RequestTime = timer:now_diff(now(), Begin)/1000,
      Code = Resp:get(code),
      Host = MochiReq:get_header_value("Host"),
      ?LOG_INFO("~s ~s ~s ~s ~B ~B", [Peer, Host,
          atom_to_list(Method1), RawUri, Code, round(RequestTime)]),
      couch_stats_collector:record({couchdb, request_time}, RequestTime),
      couch_stats_collector:increment({httpd, requests}),
      {ok, Resp}.
  
  %% HACK: replication currently handles two forms of input, #db{} style
  %% and #http_db style. We need a third that makes use of fabric. #db{}
  
negative.code:     catch
          throw:{http_head_abort, Resp0} ->
              {ok, Resp0};
          throw:{http_abort, Resp0, Reason0} ->
              {aborted, Resp0, Reason0};
          throw:{invalid_json, S} ->
              ?LOG_ERROR("attempted upload of invalid JSON ~s", [S]),
              send_error(HttpReq, {bad_request, "invalid UTF-8 JSON"});
  