Skip to content

Commit

Permalink
Merge pull request #213 from mcayland/copyobject-copysource-keys-with…
Browse files Browse the repository at this point in the history
…-slashes-fix

Fix CopyObject for CopySource containing a key with slashes
  • Loading branch information
jakobvogel committed Jan 26, 2023
2 parents ddd03de + 54fe099 commit 5004aeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/ninja/S3Dispatcher.java
Expand Up @@ -734,8 +734,8 @@ private void copyObject(WebContext webContext, Bucket bucket, String id, String
String.format("Source '%s' must contain '/'", copy));
return;
}
String srcBucketName = copy.substring(1, copy.lastIndexOf(PATH_DELIMITER));
String srcId = copy.substring(copy.lastIndexOf(PATH_DELIMITER) + 1);
String srcBucketName = copy.substring(1, copy.indexOf(PATH_DELIMITER, 1));
String srcId = copy.substring(copy.indexOf(PATH_DELIMITER, 1) + 1);
Bucket srcBucket = storage.getBucket(srcBucketName);
if (!srcBucket.exists()) {
signalObjectError(webContext,
Expand Down

0 comments on commit 5004aeb

Please sign in to comment.