glitch-javascript-sdk 1.4.5 → 1.4.7

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/esm/index.js CHANGED
@@ -5431,14 +5431,12 @@ var Requests = /** @class */ (function () {
5431
5431
  formData.append(key, data[key]);
5432
5432
  }
5433
5433
  // Prepare headers
5434
- var headers = {
5435
- 'Content-Type': 'multipart/form-data',
5436
- };
5434
+ var headers = {};
5437
5435
  if (Requests.authToken) {
5438
5436
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);
5439
5437
  }
5440
- // Construct the full URL properly
5441
- var uri = new URL(url, Requests.baseUrl).href;
5438
+ // Format URL correctly
5439
+ var uri = Requests.baseUrl.replace(/\/+$/, '') + '/' + url.replace(/^\/+/, '');
5442
5440
  // Make the request
5443
5441
  return axios$1({
5444
5442
  method: 'POST',
@@ -5475,8 +5473,9 @@ var Requests = /** @class */ (function () {
5475
5473
  if (Requests.authToken) {
5476
5474
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);
5477
5475
  }
5478
- // Construct the full URL properly
5479
- var uri = new URL(url, Requests.baseUrl).href;
5476
+ // Format URL
5477
+ url = url.replace(/\/\//g, '/');
5478
+ var uri = "".concat(Requests.baseUrl).concat(url).replace(/\/\//g, '/');
5480
5479
  // Make the request
5481
5480
  return axios$1({
5482
5481
  method: 'POST',