From a481da68e58cb20d6407c9866c1511717addfdb0 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Thu, 10 Oct 2024 10:53:59 +0200 Subject: [PATCH] [HTTP] Copy array returned by `getRoutes` (#195647) ## Summary Small follow up based on https://github.com/elastic/kibana/pull/192675#discussion_r1793601519 --- .../core/http/core-http-router-server-internal/src/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/http/core-http-router-server-internal/src/router.ts b/packages/core/http/core-http-router-server-internal/src/router.ts index 1a74e27910c1a..bb99de64581be 100644 --- a/packages/core/http/core-http-router-server-internal/src/router.ts +++ b/packages/core/http/core-http-router-server-internal/src/router.ts @@ -240,7 +240,7 @@ export class Router !route.isVersioned); } - return this.routes; + return [...this.routes]; } public handleLegacyErrors = wrapErrors;