tolgee-platform icon indicating copy to clipboard operation
tolgee-platform copied to clipboard

Publishing to Azure storage doesn't set correct MIME type

Open cfmano opened this issue 1 year ago • 7 comments

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:

  1. Setup use of Azure BLOBs
  2. To go project -> Developer settings -> Content delivery
  3. Publish translations
  4. 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 image

Versions and environment

  • Tolgee Platform version: 3.75.1
  • Environment: Docker version

cfmano avatar Oct 02 '24 14:10 cfmano

Hey! Thanks for reporting. Can you please explain why this is a problem? Thanks!

JanCizmar avatar Oct 07 '24 06:10 JanCizmar

There are basically two main reasons:

  1. 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-stream type is discouraged).
  2. 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.

cfmano avatar Oct 16 '24 23:10 cfmano

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jan 09 '25 02:01 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jan 24 '25 01:01 github-actions[bot]

Reopening because of a related support request on Slack: https://tolgeecommunity.slack.com/archives/C03A0RQR62H/p1737961060464379

Anty0 avatar Jan 31 '25 14:01 Anty0

Same issue on Amazon S3 as well.

Image

madhunandan-gs avatar Feb 06 '25 01:02 madhunandan-gs

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Mar 08 '25 01:03 github-actions[bot]