mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 16:48:58 +00:00
add timeout to requests.get
This commit is contained in:
parent
9306a72b99
commit
fad45bd6d3
1 changed files with 1 additions and 1 deletions
2
webui.py
2
webui.py
|
@ -132,7 +132,7 @@ def bot_create():
|
||||||
session['instance'] = re.match(r"^(?:https?:\/\/)?(.*)", request.form['instance']).group(1)
|
session['instance'] = re.match(r"^(?:https?:\/\/)?(.*)", request.form['instance']).group(1)
|
||||||
|
|
||||||
# check for mastodon/pleroma
|
# 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:
|
if r.status_code == 200:
|
||||||
j = r.json()
|
j = r.json()
|
||||||
if "Pleroma" in j['version']:
|
if "Pleroma" in j['version']:
|
||||||
|
|
Loading…
Reference in a new issue