Skip to content
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

Avoid errors due to mutations to options argument in the upload_file method #1416

Merged
merged 1 commit into from
Feb 10, 2017
Merged

Avoid errors due to mutations to options argument in the upload_file method #1416

merged 1 commit into from
Feb 10, 2017

Conversation

markmercedes
Copy link
Contributor

I was getting this error while trying to upload objects to S3 using the SDK

Can't modify a frozen hash

This was happening because the upload_file method was deleting a key from the hash with the uploading options provided to the method (mutating the hash)

PUBLIC_PERMISSIONS = { acl: "acl: "public-read"}.freeze

object.upload_file('path/to/file.ext', PUBLIC_PERMISSIONS)

A code like the one shown above will generate the error mentioned before, this PR has the fix for it

Hope this helps

@cjyclaire cjyclaire merged commit 53a6717 into aws:master Feb 10, 2017
@cjyclaire
Copy link
Contributor

Thank you for the contribution! I can reproduce the issue and your PR looks good to me.
I'll merge it, it will be tagged in our next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants