From 2f5aa795a3b78a6480ca986e7774b0d8131a90f5 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 19 Mar 2024 15:59:37 +0100 Subject: [PATCH] Fix: Error data was JSON encoded twice The result sent was always a string containing encoded JSON. Solution: Use the argument `text` instead of `data` to pass the data as a UTF-8 string. --- src/aleph/vm/orchestrator/views/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aleph/vm/orchestrator/views/__init__.py b/src/aleph/vm/orchestrator/views/__init__.py index 61f4e87a9..7c1fd370e 100644 --- a/src/aleph/vm/orchestrator/views/__init__.py +++ b/src/aleph/vm/orchestrator/views/__init__.py @@ -350,7 +350,7 @@ async def update_allocations(request: web.Request): data = await request.json() allocation = Allocation.parse_obj(data) except ValidationError as error: - return web.json_response(data=error.json(), status=web.HTTPBadRequest.status_code) + return web.json_response(text=error.json(), status=web.HTTPBadRequest.status_code) pubsub: PubSub = request.app["pubsub"] pool: VmPool = request.app["vm_pool"]