aus_driver_amazon_s3 icon indicating copy to clipboard operation
aus_driver_amazon_s3 copied to clipboard

[BUGFIX] Correctly set MIME type of .js and .css files

Open cweiske opened this issue 4 years ago • 5 comments

Resolves: https://github.com/andersundsehr/aus_driver_amazon_s3/issues/85

cweiske avatar Jul 22 '21 11:07 cweiske

I'm not sure if we should fix this mime type issue here in this driver. Do you know the real source of this issue? Can we solve it in a more generic way (eg. for all mime types)?

Lagerregal avatar Apr 02 '22 12:04 Lagerregal

The TYPO3 core also has a similar problem and introduced the MimeTypeDetector:

  • https://github.com/TYPO3/typo3/blob/11.5/typo3/sysext/core/Classes/Resource/MimeTypeDetector.php

There is a manual list of mappings, too, that is used by FileInfo:

  • https://docs.typo3.org/c/typo3/cms-core/9.5/en-us/Changelog/7.2/Feature-66445-AddFileExtensionToMimeTypeMapping.html
  • https://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/1c0420df596c9874acedbc4c0930f5c46182fde2/diff/typo3/sysext/core/Classes/Type/File/FileInfo.php

I don't know what the right solution is.

cweiske avatar Apr 03 '22 10:04 cweiske

I've rebased against current master and fixed the code complexity by moving the code into a new method.

@Lagerregal: Shall I rewrite it to use the TYPO3 core mime type detector, or is the current list of css+js sufficient?

(Also, this only works for files that are not empty because the normal s3client uploader is used for empty files since #69, and I do not know how to pass the MIME type to that.

cweiske avatar Nov 17 '22 17:11 cweiske

@cweiske thanks again for your contribution. I created another PR for that: #141 as i decided to use the TYPO3 mime-detector mappings for that issue.

weakbit avatar Jan 04 '24 11:01 weakbit

As long as the issue gets finally solved I'm fine with that :)

cweiske avatar Jan 04 '24 11:01 cweiske

Today we merged https://github.com/andersundsehr/aus_driver_amazon_s3/pull/141 which solves this issue

weakbit avatar Sep 30 '24 12:09 weakbit