mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +02:00
Log bad remote commands
This commit is contained in:
@@ -58,8 +58,10 @@ def parse_cmd(serialized_cmd: memoryview, encryption_key: EllipticCurveKey) -> D
|
|||||||
try:
|
try:
|
||||||
pcmd = json.loads(bytes(serialized_cmd))
|
pcmd = json.loads(bytes(serialized_cmd))
|
||||||
except Exception:
|
except Exception:
|
||||||
|
log_error('Failed to parse JSON payload of remote command, ignoring it')
|
||||||
return {}
|
return {}
|
||||||
if not isinstance(pcmd, dict) or 'version' not in pcmd:
|
if not isinstance(pcmd, dict) or 'version' not in pcmd:
|
||||||
|
log_error('JSON payload of remote command is invalid, must be an object with a version field')
|
||||||
return {}
|
return {}
|
||||||
pcmd.pop('password', None)
|
pcmd.pop('password', None)
|
||||||
if 'encrypted' in pcmd:
|
if 'encrypted' in pcmd:
|
||||||
|
|||||||
Reference in New Issue
Block a user