Skip to content

Commit 41c84fd

Browse files
LiruiYu33Copilot
andauthored
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>
1 parent d76912a commit 41c84fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/utils/web_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
"ico": "image/x-icon",
8787
"avif": "image/avif",
8888
"heic": "image/heic",
89+
# PPTX
90+
"ppt": "application/vnd.ms-powerpoint",
91+
"pptx": "application/vnd.openxmLformats-officedocument.presentationml.presentation",
8992
}
9093

9194

@@ -239,4 +242,4 @@ def hash_code(code: str, salt: bytes) -> str:
239242

240243
def captcha_key(email: str) -> str:
241244
return f"captcha:{email}"
242-
245+

0 commit comments

Comments
 (0)