summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2009-05-19 00:51:52 +0000
committerPaul Joseph Davis <davisp@apache.org>2009-05-19 00:51:52 +0000
commitc5e00c4188afd73c03bd7462ac2cc2d82387c5a6 (patch)
tree8b81059b9c9bd667db8e3771f3019aa11ce1613c /src
parentda50be8a9b46b69e0ed9a9d5182be37cf54ed21c (diff)
Add a configuration parameter for the default database handler.
Closes COUCHDB-353 Thanks Brad Anderson git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@776143 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_httpd.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 1acb6b1b..8cdc8733 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -156,10 +156,19 @@ handle_request(MochiReq, UrlHandlers, DbUrlHandlers, DesignUrlHandlers) ->
|| Part <- string:tokens(Path, "/")],
db_url_handlers = DbUrlHandlers,
design_url_handlers = DesignUrlHandlers
- },
- DefaultFun = fun couch_httpd_db:handle_request/1,
+ },
+
+ DefaultSpec = "{couch_httpd_db, handle_request}",
+ DefaultFun = make_arity_1_fun(
+ couch_config:get("httpd", "default_handler", DefaultSpec)
+ ),
HandlerFun = couch_util:dict_find(HandlerKey, UrlHandlers, DefaultFun),
+ Self = self(),
+ ok = couch_config:register(
+ fun("httpd", "default_handler") -> exit(Self, config_change) end
+ ),
+
{ok, Resp} =
try
HandlerFun(HttpReq#httpd{user_ctx=AuthenticationFun(HttpReq)})