fix: for no-such-key with non-ascii key (#112)

This commit is contained in:
Hector Ventura authored and GitHub committed 2026-03-31 00:56:46 -04:00
1 parent 68b8ed883a
commit ab072cf660
2 files changed
+176 -137

No files matched your search

@@ -25,6 +25,7 @@ import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.UriInfo;
import java.io.ByteArrayOutputStream;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.time.ZoneId;
@@ -1053,7 +1054,7 @@ public class S3Controller {
throw new AwsException("InvalidArgument", "Invalid copy source: " + copySource, 400);
}
String sourceBucket = source.substring(0, slashIndex);
String sourceKey = source.substring(slashIndex + 1);
String sourceKey = URLDecoder.decode(source.substring(slashIndex + 1), StandardCharsets.UTF_8);
S3Object copy = s3Service.copyObject(sourceBucket, sourceKey, destBucket, destKey,
httpHeaders.getHeaderString("x-amz-metadata-directive"),