apiaryio/s3-streaming-upload

Changes to objectParams can leak out of Uploader

rjz opened this issue · 0 comments

rjz commented

Supplying the same objectParams to two separate instances of Uploader can cause other options to leak between uploaders.

params =
  ContentType: 'text/csv'

uploader1 = new Uploader objectParams: params, bucket: 'bucket-1', # ...
uploader2 = new Uploader objectParams: params, bucket: 'bucket-2', # ...

console.log uploader1.objectParams.Bucket # bucket-1
console.log uploader2.objectParams.Bucket # bucket-1

This can certainly be solved in userland, but copying objectParams (rather than holding a reference) may save some head-scratching when multiple uploaders coexist in the same process.