Skip to content

Commit 1ed6bf9

Browse files
committed
mq: Validate received data in IOSubscriber
1 parent 611f721 commit 1ed6bf9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kcidb/mq/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,11 @@ def decode_data(self, message_data):
400400
Raises:
401401
An exception in case data decoding failed.
402402
"""
403-
return self.schema.upgrade(json.loads(message_data.decode()))
403+
return self.schema.upgrade(
404+
self.schema.validate(
405+
json.loads(message_data.decode())
406+
)
407+
)
404408

405409
def __init__(self, *args, schema=io.SCHEMA, **kwargs):
406410
"""

0 commit comments

Comments
 (0)