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
@@ -172,12 +172,9 @@ module.exports = class MigrationPersistor extends AbstractPersistor {
Logger.warn(err, 'error getting md5 hash from fallback persistor')
}
await this.primaryPersistor.sendStream(
destBucket,
destKey,
stream,
await this.primaryPersistor.sendStream(destBucket, destKey, stream, {
sourceMd5
)
})
} catch (err) {
const error = new WriteError(
'unable to copy file to destination persistor',