inetChecksite() fix timeout

This commit is contained in:
Sebastian Hildebrandt
2025-05-22 06:12:48 +02:00
parent 55bc6a2066
commit 754a4a0b88
6 changed files with 15 additions and 5 deletions
+2 -1
View File
@@ -425,7 +425,8 @@ function graphics(callback) {
options.stdio = ['pipe', 'pipe', 'ignore'];
}
try {
const res = execSync(cmd, options).toString();
const sanitized = util.sanitizeShellString(cmd);
const res = execSync(sanitized, options).toString();
return res;
} catch (e) {
util.noop();
+4 -1
View File
@@ -991,8 +991,11 @@ export function diskLayout(cb?: (data: Systeminformation.DiskLayoutData[]) => an
export function networkInterfaceDefault(cb?: (data: string) => any): Promise<string>;
export function networkGatewayDefault(cb?: (data: string) => any): Promise<string>;
export function networkInterfaces(): Promise<Systeminformation.NetworkInterfacesData[]>;
export function networkInterfaces(defaultString: 'default'): Promise<Systeminformation.NetworkInterfacesData>;
export function networkInterfaces(rescan: boolean): Promise<Systeminformation.NetworkInterfacesData[]>;
export function networkInterfaces(
cb?:
cb:
| ((data: Systeminformation.NetworkInterfacesData[] | Systeminformation.NetworkInterfacesData) => any)
| boolean
| string,
+1 -1
View File
@@ -2538,7 +2538,7 @@ function checkWebsite(url, timeout = 5000) {
});
})
.setTimeout(timeout, () => {
request.close();
request.destroy();
resolve({
url,
statusCode: 408,