upload: filename None-sicher an secure_filename (Typ-Warnung weg)
file.filename ist str|None. Guard faengt None jetzt mit ab, und secure_filename(file.filename or "") macht den Typ eindeutig str. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
4
app.py
4
app.py
@@ -865,10 +865,10 @@ def upload_video():
|
||||
abort(400, description="Keine Datei erhalten")
|
||||
|
||||
file = request.files["file"]
|
||||
if not file or file.filename == "":
|
||||
if not file or not file.filename:
|
||||
abort(400, description="Keine Datei ausgewaehlt")
|
||||
|
||||
filename = secure_filename(file.filename)
|
||||
filename = secure_filename(file.filename or "")
|
||||
if not filename:
|
||||
abort(400, description="Ungueltiger Dateiname")
|
||||
if not allowed_file(filename):
|
||||
|
||||
Reference in New Issue
Block a user