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/d25646fc Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/d25646fc Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/d25646fc Branch: refs/heads/1585-feature-per-module-log-levels Commit: d25646fcff088dcf670db35f45d5541e75e3bd15 Parents: 7a2836e Author: Benjamin Nortier <[email protected]> Authored: Fri Sep 21 16:46:46 2012 +0100 Committer: Jan Lehnardt <[email protected]> Committed: Tue Nov 13 15:01:54 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/d25646fc/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, []).
