Consider status code before content in checkIndex() and checkalive.py

Fixes https://github.com/WikiTeam/wikiteam/issues/369
pull/372/head
Federico Leva 4 years ago
parent 8fb2b44fdb
commit 8c6f05bb54

@ -1908,6 +1908,9 @@ def checkAPI(api=None, session=None):
def checkIndex(index=None, cookies=None, session=None):
""" Checking index.php availability """
r = session.post(url=index, data={'title': 'Special:Version'}, timeout=30)
if r.status_code >= 400:
print("ERROR: The wiki returned status code HTTP {}".format({}))
return False
raw = r.text
print 'Checking index.php...', index
# Workaround for issue 71

Loading…
Cancel
Save