New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copyObject not working when replacing metadata #30
Comments
In looking around a little more it looks like in s3.api.js the copyObject definition doesn't specify including all of the headers that a standard putObject request does which should address the first problem I was seeing of metadata not being included. |
I was able to work around the Transfer-Encoding issue with this little hack in http.js handleRequest right after the options object is created:
This would need to be cleaned up to be a general solution to the problem. |
Adds a new 'afterBuild' hook event and listener named AWS.EventListeners.Core.SET_CONTENT_LENGTH to build Content-Length on headers after services build the request object. This ensures that content length is set consistently for all input types regardless of the service interface. Note: afterBuild is a private event and is reserved for internal use only. Related to (but does not completely fix) #30
The above commit should fix the copyObject method failing outright; it does not address the other part of your issue, though (still working on that one). |
The missing headers should have been addressed in commit 362ed44. I was able to use the latest (unreleased) code to perform a copy object. This should go out with our next release. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
When trying to use s3.client.copyObject with
MetadataDirective: 'REPLACE'
I don't see standard metadata headers such as CacheControl or ContentType being included in the request. Additionally the request fails with:Indicating that the PUT request is including a header I didn't specify causing it to be rejected with a status code of 501. Seems like a variation of: https://forums.aws.amazon.com/message.jspa?messageID=191792
The text was updated successfully, but these errors were encountered: