-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws s3 type inference should supply a charset for text/ mime types #8574
Comments
Thanks for the feature request and your patience here. It looks like this closely overlaps with #1346, so we may want to consider consolidating these for tracking going forward. Are there any specific distinctions you want to highlight between these two feature requests? |
No I think this is largely a duplicate. I'd draw attention to the suggestion of using the console's default such as the |
Thanks for confirming — I'll go ahead and close this as a duplicate. Please consider adding a 👍 to the related issue and leaving a comment there if you want to add any other context. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the feature
Some commands under
aws s3
will set a mime type while uploading files. This is based on a type inference system. When the type inference system results in a type starting withtext/
it should try to append; charst=<charset>
or at least offer the option to do so.There's a number of ways this might be inferred and I'm agnostic as to which:
Use Case
Where an S3 backed cloud-front website may serve plain text files, there is no other way to indicate the charset of the file. As it stands, the current behaviour forces clients to assume US-ASKII or ISO-8859-1 and this is very rarely right.
RFC 2854 Section 6
As it stands the only way to achieve this is to completely bypass the type inference system which means users are left to build their own inference system.
By allowing the client set set a charset for either all
text/*
types or otherwise specifically set charset for specific mime types such astext/plain
, these can then be set correctly in S3 and thus be correct when retrieved through cloud-front.Proposed Solution
Add an option to set the charset explicitly for text types, or alternatively add an option to infer the charset from the current console's environment variables. This would append
; charset=...
to each text mime type. Eg:text/plain; charset=utf-8
.Other Information
No response
Acknowledgements
CLI version used
2.15.24
Environment details (OS name and version, etc.)
Macos / Linux
The text was updated successfully, but these errors were encountered: