Skip to content

Commit c20a90a

Browse files
committed
use .has for searchParams instead of checking for undefined
1 parent d827cf3 commit c20a90a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/codeql.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ export async function setupCodeQL(
488488
}
489489

490490
const parsedCodeQLURL = new URL(codeqlURL);
491+
const searchParams = new URLSearchParams(parsedCodeQLURL.search);
491492
const headers: OutgoingHttpHeaders = {
492493
accept: "application/octet-stream",
493494
};
@@ -497,7 +498,7 @@ export async function setupCodeQL(
497498
// We also don't want to send an authorization header if there's already a token provided in the URL.
498499
if (
499500
codeqlURL.startsWith(`${apiDetails.url}/`) &&
500-
new URLSearchParams(parsedCodeQLURL.search).get("token") === undefined
501+
!searchParams.has("token")
501502
) {
502503
logger.debug("Downloading CodeQL bundle with token.");
503504
headers.authorization = `token ${apiDetails.auth}`;

0 commit comments

Comments
 (0)