Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

COUCHDB-1537 Include user_ctx.name in show/list ETag

  • Loading branch information...
commit ac320479035ac7a844686f2efb5b314baa33e14c 1 parent 03598c2
@rnewson rnewson authored
Showing with 5 additions and 2 deletions.
  1. +1 −0  CHANGES
  2. +1 −0  NEWS
  3. +3 −2 src/couch_mrview/src/couch_mrview_show.erl
View
1  CHANGES
@@ -20,6 +20,7 @@ HTTP Interface:
* Added Server-Sent Events protocol to db changes API.
See http://www.w3.org/TR/eventsource/ for details.
* Make password hashing synchronous when using the /_config/admins API.
+ * Include user name in show/list ETags.
Storage System:
View
1  NEWS
@@ -24,6 +24,7 @@ This version has not been released yet.
* Make password hashing synchronous when using the /_config/admins API.
* Added utc_id UUID algorithm.
* encode database name during URL rewriting.
+ * Include user name in show/list ETags.
Version 1.2.1
-------------
View
5 src/couch_mrview/src/couch_mrview_show.erl
@@ -99,7 +99,7 @@ show_etag(#httpd{user_ctx=UserCtx}=Req, Doc, DDoc, More) ->
Doc -> couch_httpd:doc_etag(Doc)
end,
couch_httpd:make_etag({couch_httpd:doc_etag(DDoc), DocPart, Accept,
- UserCtx#user_ctx.roles, More}).
+ {UserCtx#user_ctx.name, UserCtx#user_ctx.roles}, More}).
% updates a doc based on a request
% handle_doc_update_req(#httpd{method = 'GET'}=Req, _Db, _DDoc) ->
@@ -191,9 +191,10 @@ handle_view_list(Req, Db, DDoc, LName, VDDoc, VName, Keys) ->
Args0 = couch_mrview_http:parse_qs(Req, Keys),
ETagFun = fun(BaseSig, Acc0) ->
UserCtx = Req#httpd.user_ctx,
+ Name = UserCtx#user_ctx.name,
Roles = UserCtx#user_ctx.roles,
Accept = couch_httpd:header_value(Req, "Accept"),
- Parts = {couch_httpd:doc_etag(DDoc), Accept, Roles},
+ Parts = {couch_httpd:doc_etag(DDoc), Accept, {Name, Roles}},
ETag = couch_httpd:make_etag({BaseSig, Parts}),
case couch_httpd:etag_match(Req, ETag) of
true -> throw({etag_match, ETag});
Please sign in to comment.
Something went wrong with that request. Please try again.