Merge pull request #1261 from umap-project/ajax-proxy-timeout

Catch timeout error in ajax proxy
This commit is contained in:
Yohan Boniface 2023-08-20 09:42:47 +02:00 committed by GitHub
commit 95296f31ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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(