Accounting for missing options in http utility timeout function.

This commit is contained in:
DebaucheryLibrarian 2021-03-15 04:13:09 +01:00
parent 41d06f7e9d
commit a0be8f0aa3
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ function getTimeout(options, url) {
return new Promise((resolve, reject, onCancel) => {
const timeoutId = setTimeout(() => {
reject(new Error(`URL ${url} timed out`));
}, (options.timeout || defaultOptions.timeout) + 10000);
}, (options?.timeout || defaultOptions.timeout) + 10000);
onCancel(() => clearTimeout(timeoutId));
});