Support metadata when uploading objects

Add contentType and contentEncoding options to sendStream(). These
options will set the corresponding metadata on the object.

This changes the API. The fourth argument to sendStream() used to be the
source md5. Now, it's an options object and the source md5 is a property
of that object.
This commit is contained in:
Eric Mc Sween
2020-07-08 08:13:53 -04:00
parent cd8c8b2b7f
commit 523ff9c4cd
10 changed files with 95 additions and 41 deletions
@@ -195,11 +195,13 @@ describe('MigrationPersistorTests', function () {
})
it('should send a stream to the primary', function () {
expect(primaryPersistor.sendStream).to.have.been.calledWithExactly(
expect(
primaryPersistor.sendStream
).to.have.been.calledWithExactly(
bucket,
key,
sinon.match.instanceOf(Stream.PassThrough),
md5
{ sourceMd5: md5 }
)
})
@@ -474,11 +476,13 @@ describe('MigrationPersistorTests', function () {
})
it('should send the file to the primary', function () {
expect(primaryPersistor.sendStream).to.have.been.calledWithExactly(
expect(
primaryPersistor.sendStream
).to.have.been.calledWithExactly(
bucket,
destKey,
sinon.match.instanceOf(Stream.PassThrough),
md5
{ sourceMd5: md5 }
)
})
})