From 9d32d4ec16b97007743126c432d00c70c62646db Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Mon, 16 Mar 2020 15:57:37 +0000 Subject: [PATCH] Don't modify 'opts' parameter --- services/filestore/app/js/GcsPersistor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/filestore/app/js/GcsPersistor.js b/services/filestore/app/js/GcsPersistor.js index a78bfce2cd..5a44132882 100644 --- a/services/filestore/app/js/GcsPersistor.js +++ b/services/filestore/app/js/GcsPersistor.js @@ -113,7 +113,8 @@ async function sendStream(bucketName, key, readStream, sourceMd5) { } } -async function getFileStream(bucketName, key, opts = {}) { +async function getFileStream(bucketName, key, _opts = {}) { + const opts = Object.assign({}, _opts) if (opts.end) { // S3 (and http range headers) treat 'end' as inclusive, so increase this by 1 opts.end++