From e0f5997cfd1866772f5d60f288a8f74d72b84129 Mon Sep 17 00:00:00 2001 From: Bright Chen Date: Wed, 19 Mar 2025 22:30:08 +0800 Subject: [PATCH] Disable ListService by default --- src/brpc/server.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/brpc/server.cpp b/src/brpc/server.cpp index 2da703ef83..7543954232 100644 --- a/src/brpc/server.cpp +++ b/src/brpc/server.cpp @@ -115,6 +115,7 @@ butil::static_atomic g_running_server_count = BUTIL_STATIC_ATOMIC_INIT(0); // Following services may have security issues and are disabled by default. DEFINE_bool(enable_dir_service, false, "Enable /dir"); DEFINE_bool(enable_threads_service, false, "Enable /threads"); +DEFINE_bool(enable_list_service, false, "Enable /list"); DECLARE_int32(usercode_backup_threads); DECLARE_bool(usercode_in_pthread); @@ -530,7 +531,8 @@ int Server::AddBuiltinServices() { LOG(ERROR) << "Fail to add BadMethodService"; return -1; } - if (AddBuiltinService(new (std::nothrow) ListService(this))) { + if (FLAGS_enable_list_service && + AddBuiltinService(new (std::nothrow) ListService(this))) { LOG(ERROR) << "Fail to add ListService"; return -1; }