anchor.diff:          update_doc(Req, Db, DocId, Json, [{"Location", Location}])
       end;
   
  -db_doc_req(#httpd{method='COPY'}=Req, Db, SourceDocId) ->
  +db_doc_req(#httpd{method='COPY', user_ctx=Ctx}=Req, Db, SourceDocId) ->
       SourceRev =
       case extract_header_rev(Req, chttpd:qs_value(Req, "rev")) of
           missing_rev -> nil;
  
positive.code:     Doc = couch_doc_open(Db, SourceDocId, SourceRev, []),
      % save new doc
      {ok, NewTargetRev} = fabric:update_doc(Db,
          Doc#doc{id=TargetDocId, revs=TargetRevs}, []),
      % respond
      send_json(Req, 201,
          [{"Etag", "\"" ++ ?b2l(couch_doc:rev_to_str(NewTargetRev)) ++ "\""}],
  
negative.code:     end;
  
  
  db_attachment_req(#httpd{method=Method, user_ctx=Ctx}=Req, Db, DocId, FileNameParts)
          when (Method == 'PUT') or (Method == 'DELETE') ->
      FileName = validate_attachment_name(
                      mochiweb_util:join(
  