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);