forked from DebaucheryLibrarian/traxxx
Accounting for missing options in http utility timeout function.
This commit is contained in:
@@ -142,7 +142,7 @@ function getTimeout(options, url) {
|
|||||||
return new Promise((resolve, reject, onCancel) => {
|
return new Promise((resolve, reject, onCancel) => {
|
||||||
const timeoutId = setTimeout(() => {
|
const timeoutId = setTimeout(() => {
|
||||||
reject(new Error(`URL ${url} timed out`));
|
reject(new Error(`URL ${url} timed out`));
|
||||||
}, (options.timeout || defaultOptions.timeout) + 10000);
|
}, (options?.timeout || defaultOptions.timeout) + 10000);
|
||||||
|
|
||||||
onCancel(() => clearTimeout(timeoutId));
|
onCancel(() => clearTimeout(timeoutId));
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user