@@ -174,6 +174,7 @@ export interface ICopyDestinationOptions {
174
174
*/
175
175
RetainUntilDate ?: string
176
176
Mode ?: RETENTION_MODES
177
+ MetadataDirective ?: 'COPY' | 'REPLACE'
177
178
}
178
179
179
180
export class CopyDestinationOptions {
@@ -185,6 +186,7 @@ export class CopyDestinationOptions {
185
186
private readonly LegalHold ?: 'on' | 'off'
186
187
private readonly RetainUntilDate ?: string
187
188
private readonly Mode ?: RETENTION_MODES
189
+ private readonly MetadataDirective ?: string
188
190
189
191
constructor ( {
190
192
Bucket,
@@ -195,6 +197,7 @@ export class CopyDestinationOptions {
195
197
LegalHold,
196
198
RetainUntilDate,
197
199
Mode,
200
+ MetadataDirective,
198
201
} : ICopyDestinationOptions ) {
199
202
this . Bucket = Bucket
200
203
this . Object = Object
@@ -204,6 +207,7 @@ export class CopyDestinationOptions {
204
207
this . LegalHold = LegalHold
205
208
this . Mode = Mode // retention mode
206
209
this . RetainUntilDate = RetainUntilDate
210
+ this . MetadataDirective = MetadataDirective
207
211
}
208
212
209
213
getHeaders ( ) : RequestHeaders {
@@ -238,6 +242,10 @@ export class CopyDestinationOptions {
238
242
}
239
243
}
240
244
245
+ if ( this . MetadataDirective ) {
246
+ headerOptions [ `X-Amz-Metadata-Directive` ] = this . MetadataDirective
247
+ }
248
+
241
249
if ( this . Encryption ) {
242
250
const encryptionHeaders = getEncryptionHeaders ( this . Encryption )
243
251
for ( const [ key , value ] of Object . entries ( encryptionHeaders ) ) {
0 commit comments