igv 2.15.5 → 2.15.6

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/igv.esm.js CHANGED
@@ -18578,7 +18578,6 @@ class IGVXhr {
18578
18578
  });
18579
18579
  this.RANGE_WARNING_GIVEN = false;
18580
18580
  this.oauth = new Oauth();
18581
- this.contentLengthMap = new Map();
18582
18581
  }
18583
18582
 
18584
18583
  setApiKey(key) {
@@ -18656,18 +18655,6 @@ class IGVXhr {
18656
18655
  }
18657
18656
  }
18658
18657
 
18659
- async getContentLength(url, options) {
18660
- if (!this.contentLengthMap.has(url)) {
18661
- options = options || {};
18662
- options.method = 'HEAD';
18663
- options.GET_CONTENT_LENGTH = true;
18664
- const contentLengthString = await this._loadURL(url, options);
18665
- const contentLength = contentLengthString ? Number.parseInt(contentLengthString) : -1;
18666
- this.contentLengthMap.set(url, contentLength);
18667
- }
18668
- return this.contentLengthMap.get(url)
18669
- }
18670
-
18671
18658
  async _loadURL(url, options) {
18672
18659
 
18673
18660
  const self = this;
@@ -18682,11 +18669,6 @@ class IGVXhr {
18682
18669
  oauthToken = await (typeof oauthToken === 'function' ? oauthToken() : oauthToken);
18683
18670
  }
18684
18671
 
18685
- let contentLength = -1;
18686
- if (options.range && !isAmazonV4Signed(url) && !isGoogleStorageSigned(url)) {
18687
- contentLength = await this.getContentLength(url);
18688
- }
18689
-
18690
18672
  return new Promise(function (resolve, reject) {
18691
18673
 
18692
18674
  // Various Google tansformations
@@ -18727,13 +18709,7 @@ class IGVXhr {
18727
18709
  }
18728
18710
 
18729
18711
  if (range) {
18730
- let rangeEnd = "";
18731
- if (range.size) {
18732
- rangeEnd = range.start + range.size - 1;
18733
- if (contentLength > 0) {
18734
- rangeEnd = Math.min(rangeEnd, contentLength - 1);
18735
- }
18736
- }
18712
+ var rangeEnd = range.size ? range.start + range.size - 1 : "";
18737
18713
  xhr.setRequestHeader("Range", "bytes=" + range.start + "-" + rangeEnd);
18738
18714
  // xhr.setRequestHeader("Cache-Control", "no-cache"); <= This can cause CORS issues, disabled for now
18739
18715
  }
@@ -18759,11 +18735,6 @@ class IGVXhr {
18759
18735
  }
18760
18736
 
18761
18737
  xhr.onload = async function (event) {
18762
-
18763
- if (options.GET_CONTENT_LENGTH) {
18764
- resolve(xhr.getResponseHeader('content-length'));
18765
- }
18766
-
18767
18738
  // when the url points to a local file, the status is 0 but that is not an error
18768
18739
  if (xhr.status === 0 || (xhr.status >= 200 && xhr.status <= 300)) {
18769
18740
  if (range && xhr.status !== 206 && range.start !== 0) {
@@ -19086,10 +19057,6 @@ function getGlobalObject() {
19086
19057
  }
19087
19058
  }
19088
19059
 
19089
- function isAmazonV4Signed(url) {
19090
- return url.indexOf("X-Amz-Signature") > -1
19091
- }
19092
-
19093
19060
 
19094
19061
  const igvxhr = new IGVXhr();
19095
19062
 
@@ -23971,7 +23938,7 @@ const Cytoband = function (start, end, name, typestain) {
23971
23938
  }
23972
23939
  };
23973
23940
 
23974
- const _version = "2.15.5";
23941
+ const _version = "2.15.6";
23975
23942
  function version() {
23976
23943
  return _version
23977
23944
  }