Do not pass undefined authorization header

This commit is contained in:
Henry Mercer
2024-11-11 15:04:30 +00:00
parent acb9cb18ee
commit ebbe050cf6
3 changed files with 4 additions and 3 deletions

View File

@@ -178,7 +178,8 @@ async function downloadAndExtractZstdWithStreaming(
logger: Logger,
): Promise<string> {
headers = Object.assign(
{ "User-Agent": "CodeQL Action", authorization },
{ "User-Agent": "CodeQL Action" },
authorization ? { authorization } : {},
headers,
);
const response = await new Promise<IncomingMessage>((resolve) =>