cam_framesize: val None-sicher zu int (Typ-Warnung weg)
int(str(...)) macht das Argument eindeutig; None/Nicht-Zahl -> ValueError -> abort 400. Verhalten identisch, kein int(None) mehr fuer den Type-Checker. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2
app.py
2
app.py
@@ -872,7 +872,7 @@ def cam_framesize():
|
|||||||
Der Server proxyt den Aufruf (Browser braucht keinen Direktzugriff)."""
|
Der Server proxyt den Aufruf (Browser braucht keinen Direktzugriff)."""
|
||||||
data = request.get_json(silent=True) or {}
|
data = request.get_json(silent=True) or {}
|
||||||
try:
|
try:
|
||||||
val = int(data.get("val"))
|
val = int(str(data.get("val")))
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
abort(400, description="val (int) erforderlich")
|
abort(400, description="val (int) erforderlich")
|
||||||
if val not in FRAMESIZES:
|
if val not in FRAMESIZES:
|
||||||
|
|||||||
Reference in New Issue
Block a user