From 27a56d15f4af90e91c588176e53e3603932d767f Mon Sep 17 00:00:00 2001 From: arashagp Date: Mon, 22 Jun 2026 11:54:57 +0330 Subject: [PATCH] refactor: check if an object has already content disposition header don't copy it again --- src/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.js b/src/index.js index cf89065..a02006f 100644 --- a/src/index.js +++ b/src/index.js @@ -609,6 +609,13 @@ async function copyWithNewMetadata(client, bucket, key, filename) { }), ); + if (head.ContentDisposition) { + logger.debug( + newKey, + `object: ${key} has content disposition header: ${head.ContentDisposition}`, + ); + } + const result = await client.send( new CopyObjectCommand({ Bucket: bucket,