aws s3 type inference should supply a charset for text/ mime types #8574
Labels
duplicate
This issue is a duplicate.
feature-request
A feature should be added or improved.
p2
This is a standard priority issue
s3
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: