mirror of
https://github.com/github/codeql-action.git
synced 2026-04-17 12:33:16 +00:00
use .has for searchParams instead of checking for undefined
This commit is contained in:
@@ -488,6 +488,7 @@ export async function setupCodeQL(
|
||||
}
|
||||
|
||||
const parsedCodeQLURL = new URL(codeqlURL);
|
||||
const searchParams = new URLSearchParams(parsedCodeQLURL.search);
|
||||
const headers: OutgoingHttpHeaders = {
|
||||
accept: "application/octet-stream",
|
||||
};
|
||||
@@ -497,7 +498,7 @@ export async function setupCodeQL(
|
||||
// We also don't want to send an authorization header if there's already a token provided in the URL.
|
||||
if (
|
||||
codeqlURL.startsWith(`${apiDetails.url}/`) &&
|
||||
new URLSearchParams(parsedCodeQLURL.search).get("token") === undefined
|
||||
!searchParams.has("token")
|
||||
) {
|
||||
logger.debug("Downloading CodeQL bundle with token.");
|
||||
headers.authorization = `token ${apiDetails.auth}`;
|
||||
|
||||
Reference in New Issue
Block a user