use .has for searchParams instead of checking for undefined
This commit is contained in:
parent
d827cf3d65
commit
54d25f56dd
3 changed files with 5 additions and 3 deletions
|
|
@ -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}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue