diff --git a/big_tests/tests/connect_SUITE.erl b/big_tests/tests/connect_SUITE.erl index ae02974d2ff..caaad79014f 100644 --- a/big_tests/tests/connect_SUITE.erl +++ b/big_tests/tests/connect_SUITE.erl @@ -185,7 +185,7 @@ end_per_group(_, Config) -> Config. init_per_testcase(close_connection_if_service_type_is_hidden = CN, Config) -> - OptName = {hide_service_name, <<"localhost">>}, + OptName = hide_service_name, mongoose_helper:successful_rpc(ejabberd_config, add_local_option, [OptName, true]), escalus:init_per_testcase(CN, Config); init_per_testcase(replaced_session_cannot_terminate = CN, Config) -> @@ -197,7 +197,7 @@ init_per_testcase(CaseName, Config) -> escalus:init_per_testcase(CaseName, Config). end_per_testcase(close_connection_if_service_type_is_hidden = CN, Config) -> - OptName = {hide_service_name, <<"localhost">>}, + OptName = hide_service_name, mongoose_helper:successful_rpc(ejabberd_config, del_local_option, [OptName]), escalus:end_per_testcase(CN, Config); end_per_testcase(replaced_session_cannot_terminate = CN, Config) -> diff --git a/doc/advanced-configuration/host_config.md b/doc/advanced-configuration/host_config.md index 20b45bd6f3e..496d32d52f4 100644 --- a/doc/advanced-configuration/host_config.md +++ b/doc/advanced-configuration/host_config.md @@ -30,24 +30,22 @@ The following options are allowed: * [`pgsql_users_number_estimate`](general.md#generalpgsql_users_number_estimate) * [`route_subdomains`](general.md#generalroute_subdomains) * [`replaced_wait_timeout`](general.md#generalreplaced_wait_timeout) -* [`hide_service_name`](general.md#generalhide_service_name) #### Example -The `hide_service_name` option is set to `false` only for `domain2.com`. +The `replaced_wait_timeout` option is set to `2000` only for `domain2.com`. ```toml [general] hosts = ["domain1.com", "domain2.com", "domain3.com"] loglevel = "info" - hide_service_name = true replaced_wait_timeout = 1000 [[host_config]] host = "domain2.com" [host_config.general] - hide_service_name = false + replaced_wait_timeout = 2000 ``` ### `host_config.auth` diff --git a/src/config/mongoose_config_spec.erl b/src/config/mongoose_config_spec.erl index 6de1fa56d85..5fefb26e1ad 100644 --- a/src/config/mongoose_config_spec.erl +++ b/src/config/mongoose_config_spec.erl @@ -233,7 +233,7 @@ general() -> validate = positive, format = host_local_config}, <<"hide_service_name">> => #option{type = boolean, - format = host_local_config} + format = local_config} }, format = none }. diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index fed44e9e16a..a5864232235 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -271,7 +271,7 @@ wait_for_stream(closed, StateData) -> {stop, normal, StateData}; wait_for_stream(_UnexpectedItem, #state{ server = Server, host_type = HostType } = StateData) -> - case ejabberd_config:get_local_option(hide_service_name, HostType) of + case ejabberd_config:get_local_option(hide_service_name) of true -> {stop, normal, StateData}; _ -> diff --git a/test/config_parser_SUITE.erl b/test/config_parser_SUITE.erl index 2edeeae9abf..72f5bbcc794 100644 --- a/test/config_parser_SUITE.erl +++ b/test/config_parser_SUITE.erl @@ -490,9 +490,9 @@ replaced_wait_timeout(_Config) -> err_host_config(#{<<"general">> => #{<<"replaced_wait_timeout">> => 0}}). hide_service_name(_Config) -> - eq_host_config([#local_config{key = {hide_service_name, ?HOST}, value = false}], - #{<<"general">> => #{<<"hide_service_name">> => false}}), - err_host_config(#{<<"general">> => #{<<"hide_service_name">> => []}}). + compare_config([#local_config{key = hide_service_name, value = false}], + parse(#{<<"general">> => #{<<"hide_service_name">> => false}})), + ?err(parse(#{<<"general">> => #{<<"hide_service_name">> => []}})). %% tests: listen diff --git a/test/config_parser_SUITE_data/miscellaneous.options b/test/config_parser_SUITE_data/miscellaneous.options index 99b7defa96d..df3795b4413 100644 --- a/test/config_parser_SUITE_data/miscellaneous.options +++ b/test/config_parser_SUITE_data/miscellaneous.options @@ -1,6 +1,7 @@ {config,default_server_domain,<<"localhost">>}. {config,hosts,[<<"localhost">>,<<"anonymous.localhost">>]}. {local_config,cowboy_server_name,"Apache"}. +{local_config,hide_service_name,true}. {local_config,listen, [{{5280,{0,0,0,0},tcp}, ejabberd_cowboy, @@ -59,8 +60,6 @@ {bucket_type,<<"user_bucket">>}]}. {local_config,{extauth_instances,<<"anonymous.localhost">>},1}. {local_config,{extauth_instances,<<"localhost">>},1}. -{local_config,{hide_service_name,<<"anonymous.localhost">>},true}. -{local_config,{hide_service_name,<<"localhost">>},true}. {local_config,{pgsql_users_number_estimate,<<"anonymous.localhost">>},true}. {local_config,{pgsql_users_number_estimate,<<"localhost">>},true}. {local_config,{replaced_wait_timeout,<<"anonymous.localhost">>},2000}.