reset_count: stream_id eindeutig als str (None-Typ-Warnung weg)
data.get() liefert Any|None; Type-Checker erkannte den abort-Guard nicht als Einschraenkung. str(... or "") macht den Typ eindeutig str, Verhalten identisch (None/"" -> abort 400). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2
app.py
2
app.py
@@ -842,7 +842,7 @@ def grabber_toggle():
|
||||
@app.route("/api/reset_count", methods=["POST"])
|
||||
def reset_count():
|
||||
data = request.get_json(silent=True) or {}
|
||||
stream_id = data.get("stream_id")
|
||||
stream_id = str(data.get("stream_id") or "")
|
||||
if not stream_id:
|
||||
abort(400, description="stream_id ist erforderlich")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user