Bläddra i källkod

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

Signed-off-by: -LAN- <laipz8200@outlook.com>
tags/1.1.2
-LAN- 7 månader sedan
förälder
incheckning
ac910ed200
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 1 tillägg och 0 borttagningar
  1. 1
    0
      api/controllers/files/image_preview.py

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

@@ -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


Laddar…
Avbryt
Spara