@flashbacktech/flashbackclient 0.0.55 → 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/client.js +7 -8
- package/package.json +1 -1
package/dist/api/client.js
CHANGED
|
@@ -24,11 +24,6 @@ class ApiClient {
|
|
|
24
24
|
Authorization: `Bearer ${token}`,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
else {
|
|
28
|
-
this.headers = {
|
|
29
|
-
'Content-Type': 'application/json',
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
27
|
};
|
|
33
28
|
this.authenticate = async (token, provider) => {
|
|
34
29
|
this.setAuthToken(token);
|
|
@@ -87,6 +82,12 @@ class ApiClient {
|
|
|
87
82
|
headers: this.headers,
|
|
88
83
|
body: data ? JSON.stringify(data) : null,
|
|
89
84
|
};
|
|
85
|
+
if (data) {
|
|
86
|
+
options.headers = {
|
|
87
|
+
...options.headers,
|
|
88
|
+
'Content-Type': 'application/json',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
90
91
|
const cleanPath = path.startsWith('/') ? path.substring(1) : path;
|
|
91
92
|
if (this.debug) {
|
|
92
93
|
console.log(`DEBUG: ${method} ${cleanPath} ${JSON.stringify(data)}`);
|
|
@@ -177,9 +178,7 @@ class ApiClient {
|
|
|
177
178
|
return this.makeRequest(`repo/${repoId}/apikey/${keyId}`, 'DELETE', null);
|
|
178
179
|
};
|
|
179
180
|
this.baseURL = baseURL;
|
|
180
|
-
this.headers = {
|
|
181
|
-
'Content-Type': 'application/json',
|
|
182
|
-
};
|
|
181
|
+
this.headers = {};
|
|
183
182
|
this.debug = false;
|
|
184
183
|
}
|
|
185
184
|
}
|