소스 검색

feat: replace file content type to avoid load script in svg. (#16454)

Signed-off-by: -LAN- <laipz8200@outlook.com>
-LAN- 6 달 전
부모
커밋
ac910ed200
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      api/controllers/files/image_preview.py

+ 1 - 0
api/controllers/files/image_preview.py

@@ -75,6 +75,7 @@ class FilePreviewApi(Resource):
         if args["as_attachment"]:
             encoded_filename = quote(upload_file.name)
             response.headers["Content-Disposition"] = f"attachment; filename*=UTF-8''{encoded_filename}"
+        response.headers["Content-Type"] = "application/octet-stream"
 
         return response