Skip to content

Commit 37cc199

Browse files
committed
Avoid fetching gzip content from xhr requests
1 parent 2bd24ff commit 37cc199

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

dist/spl-web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pre.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class XHR {
9090
do {
9191
retry += 1;
9292
this.xhr.open('HEAD', this.url, false);
93+
this.xhr.setRequestHeader('Accept-Encoding', 'identity')
9394
this.xhr.send(null);
9495
} while (retry < 3 && this.xhr.status != 200)
9596
this._size = size;
@@ -120,6 +121,7 @@ class XHR {
120121
do {
121122
retry += 1;
122123
this.xhr.open('GET', this.url, false);
124+
this.xhr.setRequestHeader('Accept-Encoding', 'identity')
123125
this.xhr.setRequestHeader('Range', `bytes=${pos}-${Math.min(this._size - 1, pos + len - 1)}`);
124126
this.xhr.send(null);
125127
} while (retry < 3 && this.xhr.status != 206);

0 commit comments

Comments
 (0)