From ea4b4e2dae385a197d4768e13a6da0bef5e0365f Mon Sep 17 00:00:00 2001 From: Erin Song <121973038+erinysong@users.noreply.github.com> Date: Wed, 25 Sep 2024 09:18:47 -0700 Subject: [PATCH] Add timeout to RDAP request --- src/api/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/api/views.py b/src/api/views.py index 788bd79f5..3391b6e1d 100644 --- a/src/api/views.py +++ b/src/api/views.py @@ -100,7 +100,6 @@ def available(request, domain=""): return json_response - @require_http_methods(["GET"]) @login_not_required # Since we cache domain RDAP data, cache time may need to be re-evaluated this if we encounter any memory issues @@ -113,7 +112,7 @@ def rdap(request, domain=""): if "." not in domain: domain = f"{domain}.gov" - rdap_data = requests.get(RDAP_URL.format(domain=domain)).json() + rdap_data = requests.get(RDAP_URL.format(domain=domain), timeout=5).json() return JsonResponse(rdap_data)