mirror of
https://github.com/github/codeql-action.git
synced 2026-04-28 01:48:48 +00:00
Skip checks for non-URLs for now
This commit is contained in:
Generated
+13
-10
@@ -121728,10 +121728,10 @@ var NetworkReachabilityBackend = class {
|
||||
this.agent = new import_https_proxy_agent.HttpsProxyAgent(`http://${proxy.host}:${proxy.port}`);
|
||||
}
|
||||
agent;
|
||||
async checkConnection(registry) {
|
||||
async checkConnection(url) {
|
||||
return new Promise((resolve2, reject) => {
|
||||
const req = https.request(
|
||||
getAddressString(registry),
|
||||
url,
|
||||
{
|
||||
agent: this.agent,
|
||||
method: "HEAD",
|
||||
@@ -121768,21 +121768,24 @@ async function checkConnections(logger, proxy, backend) {
|
||||
}
|
||||
for (const registry of proxy.registries) {
|
||||
const address = getAddressString(registry);
|
||||
try {
|
||||
logger.debug(`Testing connection to ${address}...`);
|
||||
const statusCode = await backend.checkConnection(registry);
|
||||
const url = URL.parse(address);
|
||||
if (url === null) {
|
||||
logger.info(
|
||||
`Successfully tested connection to ${address} (${statusCode})`
|
||||
`Skipping check for ${address} since it is not a valid URL.`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
logger.debug(`Testing connection to ${url}...`);
|
||||
const statusCode = await backend.checkConnection(url);
|
||||
logger.info(`Successfully tested connection to ${url} (${statusCode})`);
|
||||
result.add(registry);
|
||||
} catch (e) {
|
||||
if (e instanceof ReachabilityError && e.statusCode !== void 0) {
|
||||
logger.error(
|
||||
`Connection test to ${address} failed. (${e.statusCode})`
|
||||
);
|
||||
logger.error(`Connection test to ${url} failed. (${e.statusCode})`);
|
||||
} else {
|
||||
logger.error(
|
||||
`Connection test to ${address} failed: ${getErrorMessage(e)}`
|
||||
`Connection test to ${url} failed: ${getErrorMessage(e)}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user