🔀 Rebased from master

This commit is contained in:
Alicia Sykes
2022-03-29 00:58:44 +01:00
50 changed files with 865 additions and 249 deletions

View File

@@ -14,8 +14,7 @@ export default {
credentials() {
if (this.options.username && this.options.password) {
const stringifiedUser = `${this.options.username}:${this.options.password}`;
const headers = { Authorization: `Basic ${window.btoa(stringifiedUser)}` };
return { headers };
return { Authorization: `Basic ${window.btoa(stringifiedUser)}` };
}
return null;
},

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) => {