From 04b9a350f84213eba43912e7ed0e3db8793a1437 Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Fri, 28 Aug 2026 00:26:46 +0000 Subject: [PATCH 1/3] [Refactor] Use declarative array methods in filterCustomHeaders --- .../cli-kit/src/public/node/graphiql/utilities.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/cli-kit/src/public/node/graphiql/utilities.ts b/packages/cli-kit/src/public/node/graphiql/utilities.ts index 85573897f08..33775464fb4 100644 --- a/packages/cli-kit/src/public/node/graphiql/utilities.ts +++ b/packages/cli-kit/src/public/node/graphiql/utilities.ts @@ -35,11 +35,8 @@ const BLOCKED_HEADERS = new Set([ * @returns The subset of headers that are safe to forward to the Admin API. */ export function filterCustomHeaders(headers: {[key: string]: string | string[] | undefined}): {[key: string]: string} { - const customHeaders: {[key: string]: string} = {} - for (const [key, value] of Object.entries(headers)) { - if (!BLOCKED_HEADERS.has(key.toLowerCase()) && typeof value === 'string') { - customHeaders[key] = value - } - } - return customHeaders + const validEntries = Object.entries(headers).filter( + (entry): entry is [string, string] => !BLOCKED_HEADERS.has(entry[0].toLowerCase()) && typeof entry[1] === 'string', + ) + return Object.fromEntries(validEntries) } From b1313f86249bb374d313c31a2271caeccf3c9377 Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Fri, 28 Aug 2026 00:39:10 +0000 Subject: [PATCH 2/3] [Refactor] Use declarative array methods in filterCustomHeaders From 145d0f54e0fe57d16f2cd2c148c2c94cb55dc405 Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Fri, 28 Aug 2026 00:50:53 +0000 Subject: [PATCH 3/3] [Refactor] Use declarative array methods in filterCustomHeaders