glitch-javascript-sdk 1.4.5 → 1.4.6
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/cjs/index.js +6 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/util/Requests.ts +9 -0
package/package.json
CHANGED
package/src/util/Requests.ts
CHANGED
|
@@ -196,6 +196,11 @@ class Requests {
|
|
|
196
196
|
params?: Record<string, any>,
|
|
197
197
|
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
|
|
198
198
|
): AxiosPromise<Response<T>> {
|
|
199
|
+
|
|
200
|
+
if (!url.startsWith('/api')) {
|
|
201
|
+
url = `/api${url}`;
|
|
202
|
+
}
|
|
203
|
+
|
|
199
204
|
// Process URL and params
|
|
200
205
|
if (params && Object.keys(params).length > 0) {
|
|
201
206
|
const queryString = Object.entries(params)
|
|
@@ -252,6 +257,10 @@ class Requests {
|
|
|
252
257
|
chunkSize?: number, // Default chunk size of 1MB
|
|
253
258
|
): Promise<void> {
|
|
254
259
|
|
|
260
|
+
if (!uploadUrl.startsWith('/api')) {
|
|
261
|
+
uploadUrl = `/api${uploadUrl}`;
|
|
262
|
+
}
|
|
263
|
+
|
|
255
264
|
if (!chunkSize) {
|
|
256
265
|
chunkSize = 1024 * 1024
|
|
257
266
|
}
|