diff options
author | Benjamin Nortier <bjnortier@gmail.com> | 2012-09-21 16:46:46 +0100 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2012-11-02 14:02:48 +0100 |
commit | 4edbb93d2271ac1eb82f4d2bb072b8bdf6829f85 (patch) | |
tree | 0e42d7c9e1d8927fbd339c5a57e8980faa3bc701 | |
parent | 0a64f310b43b90176bb59040e7e866978c429c88 (diff) | |
download | couchdb-4edbb93d2271ac1eb82f4d2bb072b8bdf6829f85.tar.gz |
Only return X-Couch-Id (rev is available in ETag)
-rw-r--r-- | src/couchdb/couch_httpd.erl | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index da47dfcfd..eb35ff968 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, []). |