Remote diagnoser also returns code 400 or 418 when port / http ain't correctly exposed

This commit is contained in:
Alexandre Aubin 2020-03-26 19:38:34 +01:00
parent 786f2b2ddf
commit 526a3a25c9
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@ class PortsDiagnoser(Diagnoser):
try:
r = requests.post('https://diagnosis.yunohost.org/check-ports', json={'ports': ports.keys()}, timeout=30)
if r.status_code != 200:
if r.status_code not in [200, 400, 418]:
raise Exception("Bad response from the server https://diagnosis.yunohost.org/check-ports : %s - %s" % (str(r.status_code), r.content))
r = r.json()
if "status" not in r.keys():

View file

@ -29,7 +29,7 @@ class WebDiagnoser(Diagnoser):
try:
r = requests.post('https://diagnosis.yunohost.org/check-http', json={'domain': domain, "nonce": nonce}, timeout=30)
if r.status_code != 200:
if r.status_code not in [200, 400, 418]:
raise Exception("Bad response from the server https://diagnosis.yunohost.org/check-http : %s - %s" % (str(r.status_code), r.content))
r = r.json()
if "status" not in r.keys():