mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-05-12 11:12:17 -04:00
Resolve "Fuzzing Errors /api/upload"
This commit is contained in:
parent
9157dee69f
commit
853ace7d83
5 changed files with 46 additions and 5 deletions
|
@ -53,8 +53,12 @@ def upload_file():
|
|||
if not uploaded_file.filename:
|
||||
flash('No selected file')
|
||||
return redirect(request.url)
|
||||
try:
|
||||
filename, filepath = utils.save_file(uploaded_file, current_app.config['UPLOAD_FOLDER'])
|
||||
except ValueError:
|
||||
flash('Invalid Filename')
|
||||
return redirect(request.url)
|
||||
|
||||
filename, filepath = utils.save_file(uploaded_file, current_app.config['UPLOAD_FOLDER'])
|
||||
parser, mime = utils.get_file_parser(filepath)
|
||||
|
||||
if parser is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue