From 24518465f3c42547041adc4acaf19a3814b6d31c Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Thu, 21 Nov 2024 15:08:38 +0100 Subject: [PATCH] # Improvement * adds catch for undecodeable proxied content --- konova/views/map_proxy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/konova/views/map_proxy.py b/konova/views/map_proxy.py index 3ae37b5a..4834ad58 100644 --- a/konova/views/map_proxy.py +++ b/konova/views/map_proxy.py @@ -50,7 +50,10 @@ class BaseClientProxyView(View): ) content = response.content if isinstance(content, bytes): - content = content.decode("utf-8") + try: + content = content.decode("utf-8") + except UnicodeDecodeError: + content = f"Can not decode content of {url}" return content, response.status_code