couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: [2/3] git commit: Only return X-Couch-Id (rev is available in ETag)
Date Fri, 02 Nov 2012 13:32:05 GMT
Removing X-Couch-Rev breaks backwards compatibility, obliging the next
release to be 2.0. Intentional? Also, what ticket is this?


On 2 November 2012 13:02, <jan@apache.org> wrote:

> 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/master
> Commit: 4edbb93d2271ac1eb82f4d2bb072b8bdf6829f85
> Parents: 0a64f31
> Author: Benjamin Nortier <bjnortier@gmail.com>
> Authored: Fri Sep 21 16:46:46 2012 +0100
> Committer: Jan Lehnardt <jan@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, []).
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message