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/cjs/index.js CHANGED
@@ -18615,14 +18615,12 @@ var Requests = /** @class */ (function () {
18615
18615
  formData.append(key, data[key]);
18616
18616
  }
18617
18617
  // Prepare headers
18618
- var headers = {
18619
- 'Content-Type': 'multipart/form-data',
18620
- };
18618
+ var headers = {};
18621
18619
  if (Requests.authToken) {
18622
18620
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);
18623
18621
  }
18624
- // Construct the full URL properly
18625
- var uri = new URL(url, Requests.baseUrl).href;
18622
+ // Format URL correctly
18623
+ var uri = Requests.baseUrl.replace(/\/+$/, '') + '/' + url.replace(/^\/+/, '');
18626
18624
  // Make the request
18627
18625
  return axios$1({
18628
18626
  method: 'POST',
@@ -18659,8 +18657,9 @@ var Requests = /** @class */ (function () {
18659
18657
  if (Requests.authToken) {
18660
18658
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);
18661
18659
  }
18662
- // Construct the full URL properly
18663
- var uri = new URL(url, Requests.baseUrl).href;
18660
+ // Format URL
18661
+ url = url.replace(/\/\//g, '/');
18662
+ var uri = "".concat(Requests.baseUrl).concat(url).replace(/\/\//g, '/');
18664
18663
  // Make the request
18665
18664
  return axios$1({
18666
18665
  method: 'POST',