You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the click-bait issue name. Object Copy does work, but read on and see what I mean.
I've been having a discussion over at aws/aws-sdk-js#901 regarding their documentation on s3.copyObject(...). In the same document where x-amz-copy-source is specified, there are conflicting descriptions on how it should be set.
However, in the 'Request Headers' section, the documentation says:
Name:
x-amz-copy-source
Description:
The name of the source bucket and key name of the source object, separated by a slash (/).
Type: String
Default: None
Required:
Yes
Without the initial '/', srcBucket = srcObjectParams[1] ends up being the source object's key. Eventually this will fail with a
error: No bucket found for "image.png"
info: PUT /BUCKET_NAME/image.copy.png 404 207 - 60.642 ms
What should we do?
I think that in the mean time we should do something to accept both forms. Otherwise integration with other libraries fail. s3fs is an example. See s3fs/lib/s3fs.js#L345 (It does not use an initial '/')
However, I invite you all to participate on the discussion over at aws/aws-sdk-js#901.
The text was updated successfully, but these errors were encountered:
Sparragus
added a commit
to Sparragus/s3rver
that referenced
this issue
Feb 16, 2016
Sorry for the click-bait issue name. Object Copy does work, but read on and see what I mean.
I've been having a discussion over at aws/aws-sdk-js#901 regarding their documentation on
s3.copyObject(...)
. In the same document wherex-amz-copy-source
is specified, there are conflicting descriptions on how it should be set.AWS Documentation
The 'Syntax' section of the documentation says:
However, in the 'Request Headers' section, the documentation says:
So, which one should be followed?
What s3rver does
s3rver
expectsx-amz-copy-source: /source_bucket/sourceObject
. See lib/controllers.js#L264-L268.Without the initial '/',
srcBucket = srcObjectParams[1]
ends up being the source object'skey
. Eventually this will fail with aWhat should we do?
I think that in the mean time we should do something to accept both forms. Otherwise integration with other libraries fail.
s3fs
is an example. See s3fs/lib/s3fs.js#L345 (It does not use an initial '/')However, I invite you all to participate on the discussion over at aws/aws-sdk-js#901.
The text was updated successfully, but these errors were encountered: