From 82a826d420bb4e2310dd9835741fad3130c4cc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Mon, 18 Dec 2023 14:12:00 +0100 Subject: [PATCH] fix: fix image_response function after upgrade to Falcon 3.1 --- robotoff/app/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/robotoff/app/api.py b/robotoff/app/api.py index 0a92bd18e2..633f53ee3d 100644 --- a/robotoff/app/api.py +++ b/robotoff/app/api.py @@ -907,9 +907,9 @@ def image_response(image: Image.Image, resp: falcon.Response) -> None: resp.content_type = "image/jpeg" fp = io.BytesIO() image.save(fp, "JPEG") - resp.stream_len = fp.tell() + stream_len = fp.tell() fp.seek(0) - resp.stream = fp + resp.set_stream(fp, stream_len) class ImageLogoResource: