Publishing to Azure storage doesn't set correct MIME type
Describe the bug When publishing exported translation files to Azure BLOB storage, they are not exported with correct MIME type, therefore they automatically fall back to application/octet-stream type.
To Reproduce Steps to reproduce the behavior:
- Setup use of Azure BLOBs
- To go project -> Developer settings -> Content delivery
- Publish translations
- Log into azure portal, find blob file and check overview parameters
Expected behavior Files should have correct MIME types included:
- .json - application/json
- .yaml - application/yaml
- ...
Screenshots
Versions and environment
- Tolgee Platform version: 3.75.1
- Environment: Docker version
Hey! Thanks for reporting. Can you please explain why this is a problem? Thanks!
There are basically two main reasons:
- Azure CDN/FrontDoor's default caching and comprimation bahaviour includes only known types of files, which means that you have to explicitly setup caching of these files (using different rules, because adding generic
application/octet-streamtype is discouraged). - Browsers usually have undefined behaviour when handling octet-stream files - most of the time it's handled as generic file, meaning it downloads and saves the file, instead of eg. properly displaying it. Side part of undefined handling behaviour is potential problem with encoding, BOM and malformed texts - which is especially problem in localization texts.
Side (or software specific) problems can include:
- some BE frameworks don't handle octet-stream as JSON (e.g. fastify)
- MSSQL.net client handles only well-formed JSON files with proper MIME-type
- Azure Logic Apps handle octet-stream as binary format instead of text
- ...
and therefore, in none of the above-mentioned situations, dynamic loading of files executes properly
Some other examples could be googled out.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Reopening because of a related support request on Slack: https://tolgeecommunity.slack.com/archives/C03A0RQR62H/p1737961060464379
Same issue on Amazon S3 as well.
This issue is stale because it has been open for 30 days with no activity.