From b759fdb6e35762ef5586c3e552a387c4aef15a42 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 3 Dec 2025 17:09:42 +0100 Subject: [PATCH] s3: remove leading slash in CopySource --- src/storage/s3.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/s3.js b/src/storage/s3.js index cebff16bd..139e223a5 100644 --- a/src/storage/s3.js +++ b/src/storage/s3.js @@ -364,12 +364,12 @@ async function listDir(config, remotePath, batchSize, marker) { // See aws-sdk-js/issues/1302 function encodeCopySource(bucket, path) { // AWS percent-encodes some extra non-standard characters in a URI - const output = encodeURI(path).replace(/[+!"#$@&'()*+,:;=?@]/g, function(ch) { + const output = encodeURI(path).replace(/[+!"#$@&'()*,:;=?@]/g, function(ch) { return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); }); - // the slash at the beginning is optional - return `/${bucket}/${output}`; + // the slash at the beginning is optional. adding it breaks atleast intercolo.de + return `${bucket}/${output}`; } async function copyInternal(config, fullFromPath, fullToPath, fileSize, progressCallback) {