Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CopyObject for CopySource containing a key with slashes
When attempting to use CopyObject with a CopySource key containing slashes such as bar/baz/mypic.jpg S3Ninja returns an error: "sirius.kernel.health.HandledException: An error occurred: Bucket name "mybucket/bar/baz"; does not adhere to the rules. [https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html]" The problem is that S3Dispatcher's copyObject() doesn't correctly parse the bucket name and key from x-amz-copy-source as copy.lastIndexOf(PATH_DELIMITER) returns the index of the last separator in the key, rather than the index of first separator after the bucket name. Signed-off-by: Mark Cave-Ayland <[email protected]>
- Loading branch information