From 8383fb42903e46961f6a1a35c35f5cdfc0c57f5f Mon Sep 17 00:00:00 2001 From: Jim Wright Date: Thu, 23 Mar 2017 14:52:29 +0000 Subject: [PATCH] Add support for download xhr headers (#375) --- papaparse.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/papaparse.js b/papaparse.js index f00ae56..255d2ea 100644 --- a/papaparse.js +++ b/papaparse.js @@ -581,6 +581,16 @@ } xhr.open('GET', this._input, !IS_WORKER); + // Headers can only be set when once the request state is OPENED + if (this._config.downloadRequestHeaders) + { + var headers = this._config.downloadRequestHeaders; + + for (var headerName in headers) + { + xhr.setRequestHeader(headerName, headers[headerName]); + } + } if (this._config.chunkSize) {