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

Fix blank content-encoding headers #147

Merged
merged 1 commit into from
Jul 8, 2015
Merged

Conversation

fcheung
Copy link
Contributor

@fcheung fcheung commented Jul 8, 2015

The S3 docs claim that you should set the content-encoding to aws-chunked
for a streaming upload. This however results in S3 serving files with a blank
content-encoding header. After discussion with AWS support, it appears
that setting the content-encoding to aws-chunked isn't actually necessary
since S3 can infer this from other headers present in the request

See #130, #106 , #75

The S3 docs claim that you should set the content-encoding to aws-chunked
for a streaming upload. This however results in S3 serving files with a blank
content-encoding header. After discussion with AWS support, it appears
that setting the content-encoding to aws-chunked isn't actually necessary
since S3 can infer this from other headers present in the request
@lanej
Copy link
Member

lanej commented Jul 8, 2015

good hunting @fcheung

lanej added a commit that referenced this pull request Jul 8, 2015
Fix blank content-encoding headers
@lanej lanej merged commit a48674e into fog:master Jul 8, 2015
@geemus
Copy link
Member

geemus commented Jul 9, 2015

Yeesh, thanks @fcheung for continuing to chase this one.

endgame added a commit to endgame/amazonka that referenced this pull request Oct 13, 2021
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html
says that chunked requests should set `Content-Encoding: aws-chunked`.
S3 strips any occurrence of `aws-chunked` from that header, and stores
the remainder as the `ContentEncoding` metadata on the object. It
isn't very smart about this: if `aws-chunked` is the only encoding
listed, S3 will store the empty string as the encoding, which breaks
some HTTP clients and CDNs.

Multiple AWS SDKs appear to have hit this issue, and the developers of
`fog` contacted AWS support. Their suggestion was to omit the
`Content-Encoding:` header entirely because S3 is capable of figuring
it out: fog/fog-aws#147
endgame added a commit to endgame/amazonka that referenced this pull request Oct 13, 2021
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html
says that chunked requests should set `Content-Encoding: aws-chunked`.
S3 strips any occurrence of `aws-chunked` from that header, and stores
the remainder as the `ContentEncoding` metadata on the object. It
isn't very smart about this: if `aws-chunked` is the only encoding
listed, S3 will store the empty string as the encoding, which breaks
some HTTP clients and CDNs.

Multiple AWS SDKs appear to have hit this issue, and the developers of
`fog` contacted AWS support. Their suggestion was to omit the
`Content-Encoding:` header entirely because S3 is capable of figuring
it out: fog/fog-aws#147
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.

3 participants