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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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
  }