You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/01/17 23:10:16 UTC
[31/49] git commit: Revert "Document Id and Rev in response headers"
patch
Revert "Document Id and Rev in response headers" patch
This patch breaks some update handlers and also assumes that any JSON
response body with a property called 'id' is the actual id of a
created or updated document.
This reverts;
0a64f310b43b90176bb59040e7e866978c429c88
4edbb93d2271ac1eb82f4d2bb072b8bdf6829f85
b9af7ea506ac95034a91951f29e1f4249ef4317c
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/commit/e8b4536a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/tree/e8b4536a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/diff/e8b4536a
Branch: refs/heads/import
Commit: e8b4536a466fd68cbf99f37ab18a232f4f4429fe
Parents: cb8d38a
Author: Robert Newson <rn...@apache.org>
Authored: Wed Nov 21 13:03:04 2012 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Nov 21 13:43:18 2012 +0000
----------------------------------------------------------------------
src/couch_mrview_show.erl | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/e8b4536a/src/couch_mrview_show.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_show.erl b/src/couch_mrview_show.erl
index b2c3a32..3bfa035 100644
--- a/src/couch_mrview_show.erl
+++ b/src/couch_mrview_show.erl
@@ -144,21 +144,9 @@ send_doc_update_response(Req, Db, DDoc, UpdateName, Doc, DocId) ->
couch_doc:validate_docid(NewDoc#doc.id),
{ok, NewRev} = couch_db:update_doc(Db, NewDoc, Options),
NewRevStr = couch_doc:rev_to_str(NewRev),
- DocIdHeader = case DocId of
- null ->
- [{<<"json">>, {Props}}] = JsonResp0,
- case lists:keyfind(<<"id">>, 1, Props) of
- {_, NewDocId} ->
- [{<<"X-Couch-Id">>, NewDocId}];
- false ->
- []
- end;
- DocId ->
- [{<<"X-Couch-Id">>, DocId}]
- end,
{[
{<<"code">>, 201},
- {<<"headers">>, {[{<<"X-Couch-Update-NewRev">>, NewRevStr}] ++ DocIdHeader}}
+ {<<"headers">>, {[{<<"X-Couch-Update-NewRev">>, NewRevStr}]}}
| JsonResp0]};
[<<"up">>, _Other, {JsonResp0}] ->
{[{<<"code">>, 200} | JsonResp0]}