From 1abb0ded3c5bb31cfc5f6426e895ff589cfa4a24 Mon Sep 17 00:00:00 2001 From: Jacky Jiang Date: Tue, 17 Sep 2019 10:36:43 +1000 Subject: [PATCH] Allows NetworkStreamer to handle the situation where a server ignore Range-end paramenter of the http Range header and return more content than expected --- papaparse.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/papaparse.js b/papaparse.js index ae4b70d..78265ec 100755 --- a/papaparse.js +++ b/papaparse.js @@ -669,8 +669,6 @@ License: MIT if (IS_WORKER && xhr.status === 0) this._chunkError(); - else - this._start += this._config.chunkSize; }; this._chunkLoaded = function() @@ -684,7 +682,10 @@ License: MIT return; } - this._finished = !this._config.chunkSize || this._start > getFileSize(xhr); + this._start += xhr.responseText.length; + + this._finished = !this._config.chunkSize || this._start >= getFileSize(xhr); + this.parseChunk(xhr.responseText); };