plugin: nwc: handle missing params dict in request

Even though the NIP-47 specification kind of defines that requests should
always pass a params dict in their request i witnessed way too often
that clients don't include it in some requests where it is technically
not neccessary and we fail on it.
Handling this gracefully improves compatibility without obvious
downsides.
This commit is contained in:
f321x
2026-03-27 15:05:15 +01:00
parent 7afec53828
commit b9a24ae1cf
+1 -1
View File
@@ -344,7 +344,7 @@ class NWCServer(Logger, EventListener):
content = json.loads(content)
if not isinstance(content, dict):
raise Exception("malformed content, not dict")
params: dict = content['params']
params: dict = content.get('params', {})
if not isinstance(params, dict):
raise Exception("malformed params, not dict")
except Exception: