Skip to content

Commit

Permalink
fix: range parser
Browse files Browse the repository at this point in the history
  • Loading branch information
kukhariev committed Jul 15, 2019
1 parent bdc354b commit 333d7fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/uploadx/src/uploaderx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export class UploaderX extends Uploader {

protected getOffsetFromResponse() {
if (this.statusType === 300) {
const str = this.getValueFromResponse('Range');
const [match] = str && str.match(/(-1|\d+)$/g);
return match && +match + 1;
const range = this.getValueFromResponse('Range');
const end = range.split(/0-/).pop();
return end && +end + 1;
} else if (this.statusType === 200) {
return this.size;
}
Expand Down

0 comments on commit 333d7fe

Please sign in to comment.