summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Higham <martin@ocastalabs.com>2013-05-22 10:43:40 +0100
committerMartin Higham <martin@ocastalabs.com>2013-05-22 10:43:40 +0100
commit1122401b76d9c039f4cbc10a6a43bdca7edea3e8 (patch)
treee14207ee1cc28c45ac84344e384d4143877f5494
parent7a939451eb78c52ecba8df06da60a04cb8a45562 (diff)
downloadcouchdb-1122401b76d9c039f4cbc10a6a43bdca7edea3e8.tar.gz
Save the auth values so if the AuthSession cookie has passed the Time left threshold it gets updated
-rw-r--r--src/couchdb/couch_httpd.erl3
-rw-r--r--src/couchdb/couch_httpd_rewrite.erl5
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)