glitch-javascript-sdk 1.4.4 → 1.4.5

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
@@ -5437,9 +5437,8 @@ var Requests = /** @class */ (function () {
5437
5437
  if (Requests.authToken) {
5438
5438
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);
5439
5439
  }
5440
- // Format URL
5441
- url = url.replace(/\/\//g, '/');
5442
- var uri = "".concat(Requests.baseUrl).concat(url).replace(/\/\//g, '/');
5440
+ // Construct the full URL properly
5441
+ var uri = new URL(url, Requests.baseUrl).href;
5443
5442
  // Make the request
5444
5443
  return axios$1({
5445
5444
  method: 'POST',
@@ -5476,9 +5475,8 @@ var Requests = /** @class */ (function () {
5476
5475
  if (Requests.authToken) {
5477
5476
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);
5478
5477
  }
5479
- // Format URL
5480
- url = url.replace(/\/\//g, '/');
5481
- var uri = "".concat(url).replace(/\/\//g, '/');
5478
+ // Construct the full URL properly
5479
+ var uri = new URL(url, Requests.baseUrl).href;
5482
5480
  // Make the request
5483
5481
  return axios$1({
5484
5482
  method: 'POST',
@@ -5523,7 +5521,7 @@ var Requests = /** @class */ (function () {
5523
5521
  formData.append(key, data[key]);
5524
5522
  }
5525
5523
  }
5526
- fullUploadUrl = "".concat(uploadUrl);
5524
+ fullUploadUrl = "".concat(Requests.baseUrl).concat(uploadUrl);
5527
5525
  headers = {};
5528
5526
  if (Requests.authToken) {
5529
5527
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);