From 2f89e99cb80d76e0d79e57da1b669098a2ca735c Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 21 Jul 2023 12:50:37 +0200 Subject: [PATCH] Add a timeout in proxy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This view should not be used in production, but it is sometimes, so just in caseā€¦ --- umap/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umap/views.py b/umap/views.py index b8629e7b..8ebb8374 100644 --- a/umap/views.py +++ b/umap/views.py @@ -336,7 +336,7 @@ class AjaxProxy(View): request = Request(url, headers=headers) opener = build_opener() try: - proxied_request = opener.open(request) + proxied_request = opener.open(request, timeout=10) except HTTPError as e: return HttpResponse(e.msg, status=e.code, content_type="text/plain") except URLError: