# Improvement

* adds catch for undecodeable proxied content
This commit is contained in:
mpeltriaux 2024-11-21 15:08:38 +01:00
parent 86698bd289
commit a3a616dffe

View File

@ -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