This is an automated email from the ASF dual-hosted git repository. jan pushed a commit to branch feat/conf in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit fc41be1731799f406067d22044bf1090266d16b7 Author: Jan Lehnardt <[email protected]> AuthorDate: Thu Sep 13 15:08:10 2018 +0200 remove config: [httpd] vhost_global_handlers, redirect_vhost_handler --- rel/overlay/etc/default.ini | 1 - src/couch/src/couch_httpd_vhost.erl | 16 +++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini index 5b56668..7ac46a0 100644 --- a/rel/overlay/etc/default.ini +++ b/rel/overlay/etc/default.ini @@ -133,7 +133,6 @@ port = {{backend_port}} bind_address = 127.0.0.1 authentication_handlers = {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler} secure_rewrites = true -vhost_global_handlers = _utils, _uuids, _session, _users allow_jsonp = false ; Options for the MochiWeb HTTP server. ;server_options = [{backlog, 128}, {acceptor_pool_size, 16}] diff --git a/src/couch/src/couch_httpd_vhost.erl b/src/couch/src/couch_httpd_vhost.erl index f23f41d..5128427 100644 --- a/src/couch/src/couch_httpd_vhost.erl +++ b/src/couch/src/couch_httpd_vhost.erl @@ -378,10 +378,6 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}. -handle_config_change("httpd", "vhost_global_handlers", _, _, _) -> - {ok, ?MODULE:reload()}; -handle_config_change("httpd", "redirect_vhost_handler", _, _, _) -> - {ok, ?MODULE:reload()}; handle_config_change("vhosts", _, _, _, _) -> {ok, ?MODULE:reload()}; handle_config_change(_, _, _, _, _) -> @@ -394,25 +390,23 @@ handle_config_terminate(_Server, _Reason, _State) -> load_conf() -> %% get vhost globals - VHostGlobals = re:split(config:get("httpd", - "vhost_global_handlers",""), "\\s*,\\s*",[{return, list}]), + VHostGlobals = re:split("_utils, _uuids, _session, _users", "\\s*,\\s*", + [{return, list}]), %% build vhosts matching rules VHosts = make_vhosts(), %% build vhosts handler fun DefaultVHostFun = "{couch_httpd_vhost, redirect_to_vhost}", - Fun = couch_httpd:make_arity_2_fun(config:get("httpd", - "redirect_vhost_handler", DefaultVHostFun)), + Fun = couch_httpd:make_arity_2_fun(DefaultVHostFun), {VHostGlobals, VHosts, Fun}. %% cheaply determine if there are any virtual hosts %% configured at all. vhost_enabled() -> - case {config:get("httpd", "vhost_global_handlers"), - config:get("vhosts")} of - {undefined, []} -> + case config:get("vhosts") of + [] -> false; _ -> true
