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

Signed-off-by: -LAN- <laipz8200@outlook.com>
pull/14262/head
-LAN- 1 year ago committed by Bharat Ramanathan
parent de3c736063
commit fa8ce4b9aa

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

Loading…
Cancel
Save