# Improvement
* adds catch for undecodeable proxied content
This commit is contained in:
parent
86698bd289
commit
a3a616dffe
@ -50,7 +50,10 @@ class BaseClientProxyView(View):
|
|||||||
)
|
)
|
||||||
content = response.content
|
content = response.content
|
||||||
if isinstance(content, bytes):
|
if isinstance(content, bytes):
|
||||||
|
try:
|
||||||
content = content.decode("utf-8")
|
content = content.decode("utf-8")
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
content = f"Can not decode content of {url}"
|
||||||
return content, response.status_code
|
return content, response.status_code
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user