1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-12-27 14:58:59 +00:00

add timeout to requests.get

This commit is contained in:
Lynne Megido 2019-09-02 18:06:21 +10:00
parent 9306a72b99
commit fad45bd6d3

View file

@ -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']: