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

aws s3 sync doesn't guess mimetype for .properties files #2163

Closed
mblakele opened this issue Sep 7, 2016 · 2 comments
Closed

aws s3 sync doesn't guess mimetype for .properties files #2163

mblakele opened this issue Sep 7, 2016 · 2 comments
Labels
guidance Question that needs advice or information.

Comments

@mblakele
Copy link

mblakele commented Sep 7, 2016

aws-cli/1.10.56 Python/2.7.10 Darwin/15.6.0 botocore/1.4.46

When using aws s3 sync on *.properties files, the metadata content-type ends up with a value suitable for binary. It would be nice to have text/x-java-properties or another text/* type.

Workaround: use --content-type text/x-java-properties. However the sync origin may have more than one file type.

@JordonPhillips
Copy link
Member

We use the python mimetypes library to guess the type, if it can't guess then there's not much we can do. You might be able to make that request on python itself, but it will necessarily require updating python versions.

@mblakele
Copy link
Author

mblakele commented Sep 8, 2016

Consider falling back on python-magic in guess_content_type if mimetypes.guess_type returns None.

>>> import magic
>>> mime = magic.Magic(mime=True)
>>> mime.from_filename("/tmp/test.properties")
>>> mime.from_file("/tmp/test.properties")
'text/plain'

That would be an improvement on the current behavior.

@diehlaws diehlaws added guidance Question that needs advice or information. and removed question labels Jan 4, 2019
thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this issue Feb 12, 2022
…hs (aws#2163)

* fix: md5 of directories are inconsistent without sorting the file paths

* fix: md5 of directories are inconsistent without sorting the file paths (add unit tests)

Co-authored-by: Cosh_ <[email protected]>
Co-authored-by: anvar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

3 participants