mirror of
https://github.com/smittix/intercept.git
synced 2026-07-08 01:28:13 -07:00
fix(ook): address Copilot review — stale process, XSS presets, localStorage
- Detect crashed rtl_433 process via poll() and clean up stale state instead of permanently blocking restarts with 409 - Replace innerHTML+onclick preset rendering with createElement/addEventListener to prevent XSS via crafted localStorage frequency values - Normalize preset frequencies to toFixed(3) on save and render - Add try/catch + shape validation to loadPresets() for corrupted localStorage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -63,7 +63,11 @@ def start_ook() -> Response:
|
||||
|
||||
with app_module.ook_lock:
|
||||
if app_module.ook_process:
|
||||
return jsonify({'status': 'error', 'message': 'OOK decoder already running'}), 409
|
||||
# If the process exited/crashed, clean up stale state and allow restart
|
||||
if app_module.ook_process.poll() is not None:
|
||||
cleanup_ook(emit_status=False)
|
||||
else:
|
||||
return jsonify({'status': 'error', 'message': 'OOK decoder already running'}), 409
|
||||
|
||||
data = request.json or {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user