From 1e6d4c6dbbc9859e0f4a5eb1223b7eb0a237ff0d Mon Sep 17 00:00:00 2001 From: sangjanai Date: Thu, 6 Mar 2025 14:59:12 +0700 Subject: [PATCH 1/2] fix: use copy instead of reference --- engine/main.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/engine/main.cc b/engine/main.cc index 51ace2d9b..fe4d110db 100644 --- a/engine/main.cc +++ b/engine/main.cc @@ -250,8 +250,7 @@ void RunServer(std::optional host, std::optional port, .setClientMaxMemoryBodySize(1024 * 1024); // 1MiB before writing to disk auto validate_api_key = [config_service](const drogon::HttpRequestPtr& req) { - auto const& api_keys = - config_service->GetApiServerConfiguration()->api_keys; + auto api_keys = config_service->GetApiServerConfiguration()->api_keys; static const std::unordered_set public_endpoints = { "/healthz", "/processManager/destroy"}; From c04e3e5cb01ecb4b26c12f501afbbcdb811b3c16 Mon Sep 17 00:00:00 2001 From: vansangpfiev Date: Thu, 6 Mar 2025 16:37:19 +0700 Subject: [PATCH 2/2] fix: exclude swagger --- engine/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/main.cc b/engine/main.cc index fe4d110db..a51d825fc 100644 --- a/engine/main.cc +++ b/engine/main.cc @@ -252,7 +252,7 @@ void RunServer(std::optional host, std::optional port, auto validate_api_key = [config_service](const drogon::HttpRequestPtr& req) { auto api_keys = config_service->GetApiServerConfiguration()->api_keys; static const std::unordered_set public_endpoints = { - "/healthz", "/processManager/destroy"}; + "/openapi.json", "/healthz", "/processManager/destroy"}; // If API key is not set, skip validation if (api_keys.empty()) {