Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Ruby 1.9.2 Encoding issue for S3 uploads #28

Closed
kfaustino opened this Issue Sep 29, 2010 · 2 comments

Comments

Projects
None yet
2 participants

I ran the following code in ruby 1.9.2 patch level 0 and it uploaded incorrectly to s3. If I manually set Content-MD5 in the headers, I get an MD5 mismatch from Amazon.


@connection ||= Fog::AWS::Storage.new(
  :aws_access_key_id => access_key,
  :aws_secret_access_key => secret_access_key)

blob = File.read('sample.jpg')

@connection.put_object 'test', "path/sample_fog.jpg", blob,
  'Content-Type' => 'binary/octet-stream',
  'x-amz-acl' => 'public-read'
Owner

geemus commented Sep 29, 2010

turns out 1.9 encoded strings were not getting their length counted correctly, which could result in only a portion being uploaded (because it would mistakenly thing the encoded string was number of characters, rather than number of bytes long). This has been fixed in excon, which should bubble up to make fog behave properly. The fix is released in 0.3.7

Thank you :)

adillera pushed a commit to adillera/fog that referenced this issue Mar 4, 2012

Merge pull request #28 from Keoven/authentication_update
[openstack|compute] Add Identity Enpoint to Recognized Init Parameters

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment