Adds option for request timeout in widgets

This commit is contained in:
Alicia Sykes
2022-03-27 21:21:59 +01:00
parent 56798fbdc4
commit 979a776b68
2 changed files with 6 additions and 2 deletions

View File

@@ -106,8 +106,9 @@ const WidgetMixin = {
const CustomHeaders = options || null;
const headers = this.useProxy
? { 'Target-URL': endpoint, CustomHeaders: JSON.stringify(CustomHeaders) } : CustomHeaders;
const timeout = this.options.timeout || 500;
const requestConfig = {
method, url, headers, data,
method, url, headers, data, timeout,
};
// Make request
return new Promise((resolve, reject) => {