From fad45bd6d3589e57602c3617152e7af46dad65da Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 2 Sep 2019 18:06:21 +1000 Subject: [PATCH] add timeout to requests.get --- webui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webui.py b/webui.py index 3881696..e2fa85f 100644 --- a/webui.py +++ b/webui.py @@ -132,7 +132,7 @@ def bot_create(): session['instance'] = re.match(r"^(?:https?:\/\/)?(.*)", request.form['instance']).group(1) # check for mastodon/pleroma - r = requests.get("https://{}/api/v1/instance".format(session['instance'])) + r = requests.get("https://{}/api/v1/instance".format(session['instance']), timeout=10) if r.status_code == 200: j = r.json() if "Pleroma" in j['version']: