[#7467] forced serving conten-type for xlsx, docx and pptx

This commit is contained in:
Gani Georgiev
2026-05-04 13:10:01 +03:00
parent a104de5b9f
commit 7da023f345
2 changed files with 15 additions and 3 deletions

View File

@@ -5,6 +5,8 @@
- Replaced "IBM Plex Sans" text font with "Inter" as there were reports for being difficult to read on dark background as it was too "thin" (specifically on Firefox).
_If you are still having issues with the text readability, please open an issue with more details about your OS and browser to try to workaround it._
- Serve fixed `Content-Type` for `.xlsx`, `.docx` and `.pptx` files to allow previews on iOS ([#7467](https://github.com/pocketbase/pocketbase/discussions/7467)).
## v0.37.5

View File

@@ -411,10 +411,20 @@ var inlineServeContentTypes = []string{
// manualExtensionContentTypes is a map of file extensions to content types.
var manualExtensionContentTypes = map[string]string{
".svg": "image/svg+xml", // (see https://github.com/whatwg/mimesniff/issues/7)
".css": "text/css", // (see https://github.com/gabriel-vasile/mimetype/pull/113)
".js": "text/javascript", // (see https://github.com/pocketbase/pocketbase/issues/6597)
// https://github.com/whatwg/mimesniff/issues/7
".svg": "image/svg+xml",
// https://github.com/gabriel-vasile/mimetype/pull/113
".css": "text/css",
// https://github.com/pocketbase/pocketbase/issues/6597
".js": "text/javascript",
".mjs": "text/javascript",
// https://github.com/pocketbase/pocketbase/discussions/7467
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
}
// forceAttachmentParam is the name of the request query parameter to