summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_db.erl
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2009-03-18 12:15:17 +0000
committerJan Lehnardt <jan@apache.org>2009-03-18 12:15:17 +0000
commit56063e82a2ad88a6c4125906d64a6de7e8a8b7ee (patch)
tree11a0cc21528f67bfd33858162d3b474e92f271aa /src/couchdb/couch_httpd_db.erl
parent2ee3c710ae726c31812cabb4827e777687ab660c (diff)
remove MOVE requests as they can't sensibly be supported and COPY & DELETE does the same thing
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@755575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_db.erl')
-rw-r--r--src/couchdb/couch_httpd_db.erl27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 3680d73b..aa491f8c 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -494,33 +494,8 @@ db_doc_req(#httpd{method='COPY'}=Req, Db, SourceDocId) ->
throw(Error)
end;
-db_doc_req(#httpd{method='MOVE'}=Req, Db, SourceDocId) ->
- SourceRev = {SourceRevPos, SourceRevId} =
- case extract_header_rev(Req, couch_httpd:qs_value(Req, "rev")) of
- missing_rev ->
- throw({bad_request, "MOVE requires a specified rev parameter"
- "for the origin resource."});
- Rev -> Rev
- end,
-
- {TargetDocId, TargetRevs} = parse_copy_destination_header(Req),
- % open revision Rev or Current
- Doc = couch_doc_open(Db, SourceDocId, SourceRev, []),
-
- % save new doc & delete old doc in one operation
- Docs = [
- #doc{id=SourceDocId, revs={SourceRevPos, [SourceRevId]}, deleted=true},
- Doc#doc{id=TargetDocId, revs=TargetRevs}
- ],
- {ok, [SourceResult, TargetResult]} = couch_db:update_docs(Db, Docs, []),
-
- send_json(Req, 201, {[
- {SourceDocId, update_result_to_json(SourceResult)},
- {TargetDocId, update_result_to_json(TargetResult)}
- ]});
-
db_doc_req(Req, _Db, _DocId) ->
- send_method_not_allowed(Req, "DELETE,GET,HEAD,POST,PUT,COPY,MOVE").
+ send_method_not_allowed(Req, "DELETE,GET,HEAD,POST,PUT,COPY").
update_result_to_json({ok, NewRev}) ->
{[{rev, couch_doc:rev_to_str(NewRev)}]};