From 41c84fd78fa0ad9d08f1b105bab2cc6bcbae1037 Mon Sep 17 00:00:00 2001 From: LIRUI YU <128563231+LiruiYu33@users.noreply.github.com> Date: Tue, 13 Jan 2026 12:17:49 +0800 Subject: [PATCH] Add MIME types for PPT and PPTX files (#12562) Otherwise, slide files cannot be opened in Chat module ### What problem does this PR solve? Backend Reason (API): In the api/utils/web_utils.py file of the backend, the CONTENT_TYPE_MAP dictionary is missing ppt and pptx. MIME type mapping. This means that when the frontend requests a PPTX file, the backend cannot correctly inform the browser that it is a PPTX file, resulting in the file being displayed incorrectly. Type identification error. ### Type of change - Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- api/utils/web_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/utils/web_utils.py b/api/utils/web_utils.py index 11e8428b7..c13889be2 100644 --- a/api/utils/web_utils.py +++ b/api/utils/web_utils.py @@ -86,6 +86,9 @@ CONTENT_TYPE_MAP = { "ico": "image/x-icon", "avif": "image/avif", "heic": "image/heic", + # PPTX + "ppt": "application/vnd.ms-powerpoint", + "pptx": "application/vnd.openxmLformats-officedocument.presentationml.presentation", } @@ -239,4 +242,4 @@ def hash_code(code: str, salt: bytes) -> str: def captcha_key(email: str) -> str: return f"captcha:{email}" - \ No newline at end of file +