Skip to content
Snippets Groups Projects

Add file extension to locally-stored media

All threads resolved!

What does this MR do?

When using internal file storage (not S3), files are saved without a file extension. This prevents them from being served by Nginx, as the latter has no support for MIME sniffing. The response Content-Type header is derived solely from the file extension, which obviously doesn't work if the file is extension-less. This PR attaches a file extension to all local files, matching the behavior of the S3 file storage.

Practically speaking, this will have no impact on most instances. Only non-standard configurations will benefit, such as those using the reverse-proxy to serve files without involving the backend. Low-end servers are most likely to use this configuration, as it greatly reduces latency and CPU/IO overhead by removing an entire hop from the network path.

Contribution Guidelines

By submitting this merge request, you agree to follow our Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
  • I have made sure to test this merge request
Edited by Hazelnoot

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading