Skip to content

Commit 7dbb922

Browse files
committed
refactor: change to default initialisation and add comment
1 parent c5720d2 commit 7dbb922

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

lib/tools-download.js

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tools-download.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tools-download.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,7 @@ async function downloadAndExtractZstdWithStreaming(
187187
logger: Logger,
188188
): Promise<string> {
189189
// Attempt to detect a proxy URL that should be used for the download.
190-
let downloadUrl = codeqlURL;
191-
const proxyUrl = adjustUrlByProxy(codeqlURL);
192-
if (proxyUrl) {
193-
downloadUrl = proxyUrl;
194-
}
190+
const downloadUrl = adjustUrlByProxy(codeqlURL) || codeqlURL;
195191

196192
headers = Object.assign(
197193
{ "User-Agent": "CodeQL Action" },
@@ -226,6 +222,7 @@ function sanitizeUrlForStatusReport(url: string): string {
226222
: "sanitized-value";
227223
}
228224

225+
// Auxiliary function to retrieve the proxy URL to use for a given URL, if proxy settings are configured.
229226
function adjustUrlByProxy(url: string): string | undefined {
230227
const proxyUrl = getProxyUrl(new URL(url));
231228
return proxyUrl ? proxyUrl.toString() : undefined;

0 commit comments

Comments
 (0)