You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ns...@apache.org on 2012/11/17 20:52:50 UTC
[16/30] git commit: Only return X-Couch-Id (rev is available in ETag)
Only return X-Couch-Id (rev is available in ETag)
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/4edbb93d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/4edbb93d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/4edbb93d
Branch: refs/heads/docs
Commit: 4edbb93d2271ac1eb82f4d2bb072b8bdf6829f85
Parents: 0a64f31
Author: Benjamin Nortier <bj...@gmail.com>
Authored: Fri Sep 21 16:46:46 2012 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Nov 2 14:02:48 2012 +0100
----------------------------------------------------------------------
src/couchdb/couch_httpd.erl | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/4edbb93d/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index da47dfc..eb35ff9 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -692,19 +692,19 @@ send_json(Req, Code, Headers, Value) ->
{"Content-Type", negotiate_content_type(Req)},
{"Cache-Control", "must-revalidate"}
],
- IdAndRevHeaders = case Value of
- {Props} when is_list(Props) ->
- case {lists:keyfind(id, 1, Props), lists:keyfind(rev, 1, Props)} of
- {{_, Id}, {_, Rev}} ->
- [{"X-Couch-Id", Id}, {"X-Couch-Rev", Rev}];
- _ ->
- []
- end;
- _ ->
- []
- end,
+ IdHeader = case Value of
+ {Props} when is_list(Props) ->
+ case lists:keyfind(id, 1, Props) of
+ {_, Id} ->
+ [{"X-Couch-Id", Id}];
+ _ ->
+ []
+ end;
+ _ ->
+ []
+ end,
Body = [start_jsonp(), ?JSON_ENCODE(Value), end_jsonp(), $\n],
- send_response(Req, Code, DefaultHeaders ++ IdAndRevHeaders ++ Headers, Body).
+ send_response(Req, Code, DefaultHeaders ++ IdHeader ++ Headers, Body).
start_json_response(Req, Code) ->
start_json_response(Req, Code, []).