mirror of https://github.com/OWASP/Nettacker.git
bug fix in webui export name and mimetype
This commit is contained in:
parent
4115a27e25
commit
5a69fb4be1
|
|
@ -104,6 +104,7 @@ def mime_types():
|
|||
".tiff": "image/tiff",
|
||||
".ts": "application/typescript",
|
||||
".ttf": "font/ttf",
|
||||
".txt": "text/plain",
|
||||
".vsd": "application/vnd.visio",
|
||||
".wav": "audio/x-wav",
|
||||
".weba": "audio/webm",
|
||||
|
|
|
|||
|
|
@ -348,11 +348,14 @@ def get_result_content():
|
|||
filename, file_content = get_scan_result(scan_id)
|
||||
return Response(
|
||||
file_content,
|
||||
mimetype=mime_types().get(filename.split('.')[-1]),
|
||||
mimetype=mime_types().get(
|
||||
os.path.splitext(filename)[1],
|
||||
"text/plain"
|
||||
),
|
||||
headers={
|
||||
'Content-Disposition': 'attachment;filename=' + filename
|
||||
'Content-Disposition': 'attachment;filename=' + filename.split('/')[-1]
|
||||
}
|
||||
) if file_content not in [404, 500] else filename, content
|
||||
)
|
||||
|
||||
|
||||
@app.route("/results/get_json", methods=["GET"])
|
||||
|
|
|
|||
Loading…
Reference in New Issue