Catch timeout error in ajax proxy

This commit is contained in:
Yohan Boniface 2023-08-17 17:43:25 +02:00
parent 7452681b31
commit b5d0b50183

View file

@ -343,6 +343,8 @@ class AjaxProxy(View):
return HttpResponseBadRequest("URL error") return HttpResponseBadRequest("URL error")
except InvalidURL: except InvalidURL:
return HttpResponseBadRequest("Invalid URL") return HttpResponseBadRequest("Invalid URL")
except TimeoutError:
return HttpResponseBadRequest("Timeout")
else: else:
status_code = proxied_request.code status_code = proxied_request.code
mimetype = proxied_request.headers.get( mimetype = proxied_request.headers.get(