From 1122401b76d9c039f4cbc10a6a43bdca7edea3e8 Mon Sep 17 00:00:00 2001 From: Martin Higham Date: Wed, 22 May 2013 10:43:40 +0100 Subject: Save the auth values so if the AuthSession cookie has passed the Time left threshold it gets updated --- src/couchdb/couch_httpd.erl | 3 ++- src/couchdb/couch_httpd_rewrite.erl | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 66d28d2a2..7c89d0e6d 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -316,7 +316,8 @@ handle_request_int(MochiReq, DefaultFun, design_url_handlers = DesignUrlHandlers, default_fun = DefaultFun, url_handlers = UrlHandlers, - user_ctx = erlang:erase(pre_rewrite_user_ctx) + user_ctx = erlang:erase(pre_rewrite_user_ctx), + auth = erlang:erase(pre_rewrite_auth) }, HandlerFun = couch_util:dict_find(HandlerKey, UrlHandlers, DefaultFun), diff --git a/src/couchdb/couch_httpd_rewrite.erl b/src/couchdb/couch_httpd_rewrite.erl index 232d2a362..1187397f8 100644 --- a/src/couchdb/couch_httpd_rewrite.erl +++ b/src/couchdb/couch_httpd_rewrite.erl @@ -198,8 +198,11 @@ handle_rewrite_req(#httpd{ design_url_handlers = DesignUrlHandlers, default_fun = DefaultFun, url_handlers = UrlHandlers, - user_ctx = UserCtx + user_ctx = UserCtx, + auth = Auth } = Req, + + erlang:put(pre_rewrite_auth, Auth), erlang:put(pre_rewrite_user_ctx, UserCtx), couch_httpd:handle_request_int(MochiReq1, DefaultFun, UrlHandlers, DbUrlHandlers, DesignUrlHandlers) -- cgit v1.2.1