From 04223544783058178d58856a8778a52aed85c61d Mon Sep 17 00:00:00 2001 From: nohehf Date: Mon, 26 Aug 2024 16:07:12 +0200 Subject: [PATCH] fix: allheaders --- src/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9ef3a31..d2d901c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,10 +11,7 @@ export async function createPostmanCollection( authHeader?: [string, string], ) { // Pass all headers to fetchIntrospection, including the global authHeader - const allHeaders = headers; - if (authHeader) { - allHeaders.push(authHeader); - } + const allHeaders = authHeader ? [...headers, authHeader] : headers; const introspection = await fetchIntrospection(url, allHeaders); const outrospection = outrospect(introspection);