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

PutObject fails in version 2-preview (2.0.0.1) to set Content-Encoding header #27

Closed
evereq opened this issue Jul 30, 2013 · 3 comments
Closed

Comments

@evereq
Copy link

evereq commented Jul 30, 2013

I have new issues with PutObject (and PutObjectAsync) after upgrade to v2 preview: it seems like if you set "Content-Encoding" Header in request, corresponding file in S3 for some reason does not have such header.

I create repository on Github so one can reproduce issues I have (well, it's very basic console apps):
https://github.com/evereq/AWSAsyncTest

It contains 2 solutions, each one use different version of AWS SDK: one without Old prefix use new version 2.0.0.1 and one with Old prefix uses stable version 1.5.28.1.

You also need to add your own configuration inside AWSConfig.cs file: AWS Key, Secret, S3 Folder, etc.

After you configure try to run both apps:

  • When you run Old console application, it attempts to put local file to S3 folder and succeed and resulting file have "Content-Encoding" set to "gzip". So that means that old SDK 1.5.28.1 works well with such headers.
  • When you run latest console application (without Old), it attempts to put local file with the same "Content-Encoding" set to "gzip", however if you check S3 you will see that there is no such header.
  • Note also that other Headers are set correctly by both SDK versions, for example "Cache-Control" is set to "max-age=31536000, public".
  • Also note that for v2 of SDK, I tried to execute putObjectRequest.Headers.ContentEncoding = "gzip"
    instead of
    putObjectRequest.Headers["Content-Encoding"] = "gzip"
    however it does not make any difference - file in S3 still luck of such header!

Please note that basically there are no differences between 2 solutions, except different version of AWS SDK.

Any help really appreciated!
Without that I can't upload Gziped files to S3 and can't save some trees in the world! ;-)

@PavelSafronov
Copy link

We're looking into this, but at the moment it seems that this isn't an issue with the 3.5 version of the new SDK.

@normj
Copy link
Member

normj commented Aug 2, 2013

I have pushed out version 2.0.0.2 of the preview which fixes this issue of setting the Content-Encoding header in the .NET 4.5 runtime. Content-Disposition had the same problem which was fixed in this release.

@evereq
Copy link
Author

evereq commented Aug 3, 2013

Thanks, works now in v2.0.0.2.

@evereq evereq closed this as completed Aug 3, 2013
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

No branches or pull requests

3 participants