mirror of
https://codeberg.org/gothub/gothub-instances
synced 2024-12-06 19:16:17 +01:00
Skip if response status code isn't 200 or content-type isn't json
Signed-off-by: Odyssey <hi@odyssey346.dev>
This commit is contained in:
@@ -49,6 +49,12 @@ for row in rows:
|
||||
|
||||
try:
|
||||
r = requests.get(link + '/api/v1/version', headers=headers)
|
||||
if r.status_code != 200:
|
||||
print("Error while fetching " + link + '/api/v1/version. We got a ' + str(r.status_code) + ' status code. Skipping...')
|
||||
continue
|
||||
if r.headers['Content-Type'] != 'application/json':
|
||||
print("Error while fetching " + link + '/api/v1/version. We got a ' + r.headers['Content-Type'] + ' content type. Skipping...')
|
||||
continue
|
||||
except:
|
||||
print("Error while fetching " + link + '/api/v1/version. Skipping...')
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user