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/cjs/index.js CHANGED
@@ -18621,9 +18621,8 @@ var Requests = /** @class */ (function () {
18621
18621
  if (Requests.authToken) {
18622
18622
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);
18623
18623
  }
18624
- // Format URL
18625
- url = url.replace(/\/\//g, '/');
18626
- var uri = "".concat(Requests.baseUrl).concat(url).replace(/\/\//g, '/');
18624
+ // Construct the full URL properly
18625
+ var uri = new URL(url, Requests.baseUrl).href;
18627
18626
  // Make the request
18628
18627
  return axios$1({
18629
18628
  method: 'POST',
@@ -18660,9 +18659,8 @@ var Requests = /** @class */ (function () {
18660
18659
  if (Requests.authToken) {
18661
18660
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);
18662
18661
  }
18663
- // Format URL
18664
- url = url.replace(/\/\//g, '/');
18665
- var uri = "".concat(url).replace(/\/\//g, '/');
18662
+ // Construct the full URL properly
18663
+ var uri = new URL(url, Requests.baseUrl).href;
18666
18664
  // Make the request
18667
18665
  return axios$1({
18668
18666
  method: 'POST',
@@ -18707,7 +18705,7 @@ var Requests = /** @class */ (function () {
18707
18705
  formData.append(key, data[key]);
18708
18706
  }
18709
18707
  }
18710
- fullUploadUrl = "".concat(uploadUrl);
18708
+ fullUploadUrl = "".concat(Requests.baseUrl).concat(uploadUrl);
18711
18709
  headers = {};
18712
18710
  if (Requests.authToken) {
18713
18711
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);