diff --git a/src/main/java/ninja/S3Dispatcher.java b/src/main/java/ninja/S3Dispatcher.java index ea59431..67eb12d 100644 --- a/src/main/java/ninja/S3Dispatcher.java +++ b/src/main/java/ninja/S3Dispatcher.java @@ -766,6 +766,7 @@ private void copyObject(WebContext webContext, Bucket bucket, String key, String } // parse the path of the source object + sourcePath = Strings.urlDecode(sourcePath); int sourceBucketNameStart = sourcePath.startsWith(PATH_DELIMITER) ? PATH_DELIMITER.length() : 0; String sourceBucketName = sourcePath.substring(sourceBucketNameStart, sourcePath.indexOf(PATH_DELIMITER, sourceBucketNameStart)); diff --git a/src/test/java/BaseAWSSpec.groovy b/src/test/java/BaseAWSSpec.groovy index 99d37d0..8fb7bd2 100644 --- a/src/test/java/BaseAWSSpec.groovy +++ b/src/test/java/BaseAWSSpec.groovy @@ -421,7 +421,7 @@ abstract class BaseAWSSpec extends BaseSpecification { def "Copying an object within the same bucket works as expected"() { given: def bucketName = DEFAULT_BUCKET_NAME - def keyFrom = "content" + def keyFrom = DEFAULT_KEY def keyTo = keyFrom + "-copy" def content = "I am pointless text content, but I deserve to exist twice and will thus be copied!" def client = getClient() @@ -451,7 +451,7 @@ abstract class BaseAWSSpec extends BaseSpecification { given: def bucketNameFrom = DEFAULT_BUCKET_NAME def bucketNameTo = DEFAULT_BUCKET_NAME + "-copy" - def key = "content" + def key = DEFAULT_KEY def content = "I am pointless text content, but I deserve to exist twice and will thus be copied!" def client = getClient() when: