From 98428743d3aa306e4d05c86c9bb7823658c07138 Mon Sep 17 00:00:00 2001 From: Su Date: Mon, 20 Mar 2023 16:22:14 -0700 Subject: [PATCH] address comment Signed-off-by: Su --- .../console/server/routes/api/console/proxy/create_handler.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts index 5940581b246a..2ed943f4576a 100644 --- a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts +++ b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts @@ -83,11 +83,10 @@ export const createHandler = ({ }: RouteDependencies): RequestHandler => async (ctx, request, response) => { const { body, query } = request; const { path, method } = query; + const client = ctx.core.opensearch.client.asCurrentUser; let opensearchResponse: ApiResponse; - const client = ctx.core.opensearch.client.asCurrentUser; - if (!pathFilters.some((re) => re.test(path))) { return response.forbidden({ body: `Error connecting to '${path}':\n\nUnable to send requests to that path.`,