From e760e107ea3f76d6d679bb57798f751844862b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bonhomme?= Date: Tue, 19 Dec 2023 10:28:06 +0100 Subject: [PATCH] chg: [MAS] Removed use;ess octet stream header. --- scandale/aggregation.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scandale/aggregation.py b/scandale/aggregation.py index a7f371c..2fb9c8e 100644 --- a/scandale/aggregation.py +++ b/scandale/aggregation.py @@ -34,18 +34,15 @@ async def on_start(self): "Content-Type": "application/json", "accept": "application/json", } - self.headers_octet_stream = { - "Content-Type": "application/octet-stream", - } async def run(self): - msg = await self.receive(timeout=10) # wait for a message for 10 seconds + msg = await self.receive(timeout=10) # Wait for a message for 10 seconds if msg: print(f"Message received with content: {msg.body}") try: - # Convert the JSON message message to a JSON object + # Convert the JSON string to a JSON object dict_msg = json.loads(msg.body) - # Validate the format with pydantic + # Validate the format with Pydantic ScanDataCreate(**dict_msg) except json.decoder.JSONDecodeError: return