s3cmd using incorrect MIME type for .js files

503 views Asked by At

I recently upgraded my laptop and my s3cmd script to version 2.2.0 but my *.js files that used to upload with Content-Type "application/javascript" now use "text/plain". Here's the command I've been using:

python s3cmd --access_key=<key> --secret_key=<secret> --guess-mime-type --no-mime-magic put test.js s3://bucket

Seems like it should identify *.js files as JavaScript but it's not working since the upgrade. Is this a bug, or possibly a Windows 11 issue, or am I missing something?

1

There are 1 answers

0
Register Sole On

There is a similar issue on Github for CSS files. While they mentioned they fix it in version >= 2.2.0, seems it has been historically a long-standing issue with s3cmd.

One of the workaround suggested is to manually remove python3-magic. This forces s3cmd to guess the MIME type.