bruce-models 1.5.6 → 1.5.8

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.
@@ -540,7 +540,7 @@
540
540
  }
541
541
  params.headers = params.headers || {};
542
542
  params.headers = Object.assign({ "Content-Type": "application/json;" }, params.headers);
543
- if (this.ssidHeader) {
543
+ if (this.ssidHeader && this.ssid) {
544
544
  params.headers[this.ssidHeader] = this.ssid;
545
545
  }
546
546
  const res = yield fetch(url, {
@@ -555,7 +555,10 @@
555
555
  params = {};
556
556
  }
557
557
  params.headers = params.headers || {};
558
- params.headers = Object.assign({ "Content-Type": "application/json;", [this.ssidHeader]: this.ssid }, params.headers);
558
+ params.headers = Object.assign({ "Content-Type": "application/json;" }, params.headers);
559
+ if (this.ssidHeader && this.ssid) {
560
+ params.headers[this.ssidHeader] = this.ssid;
561
+ }
559
562
  const res = yield fetch(url, {
560
563
  headers: params.headers,
561
564
  method: "DELETE"
@@ -569,7 +572,10 @@
569
572
  params = {};
570
573
  }
571
574
  params.headers = params.headers || {};
572
- params.headers = Object.assign({ "Content-Type": "application/json;", [this.ssidHeader]: this.ssid }, params.headers);
575
+ params.headers = Object.assign({ "Content-Type": "application/json;" }, params.headers);
576
+ if (this.ssidHeader && this.ssid) {
577
+ params.headers[this.ssidHeader] = this.ssid;
578
+ }
573
579
  if (!data) {
574
580
  data = {};
575
581
  }
@@ -590,7 +596,10 @@
590
596
  params = {};
591
597
  }
592
598
  params.headers = params.headers || {};
593
- params.headers = Object.assign({ "Content-Type": "application/json;", [this.ssidHeader]: this.ssid }, params.headers);
599
+ params.headers = Object.assign({ "Content-Type": "application/json;" }, params.headers);
600
+ if (this.ssidHeader && this.ssid) {
601
+ params.headers[this.ssidHeader] = this.ssid;
602
+ }
594
603
  if (!data) {
595
604
  data = {};
596
605
  }
@@ -644,7 +653,7 @@
644
653
  }
645
654
  };
646
655
  xhr.open("POST", url, true);
647
- if (this.ssid) {
656
+ if (this.ssidHeader && this.ssid) {
648
657
  xhr.setRequestHeader(this.ssidHeader, this.ssid);
649
658
  }
650
659
  const formData = new FormData();
@@ -841,7 +850,8 @@
841
850
  this.setBaseUrl();
842
851
  }
843
852
  setBaseUrl() {
844
- const prefix = "https://cam.nextspace";
853
+ // Using proxy through admin-app until CORS stops dying.
854
+ const prefix = `https://${exports.Api.TEMPLATE_ACCOUNT_ID}.nextspace`;
845
855
  let url;
846
856
  const env = this.env.toUpperCase();
847
857
  switch (env) {
@@ -860,7 +870,7 @@
860
870
  default:
861
871
  throw ("Specified Environment is not valid. SuppliedEnv=" + env);
862
872
  }
863
- this.baseUrl = url;
873
+ this.baseUrl = url + "@CAM/";
864
874
  }
865
875
  GetBaseUrl() {
866
876
  return this.baseUrl;