Set user-agent to opwngrid.xyz

Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2025-01-01 15:05:53 +01:00
parent fc0c72f7df
commit 09aace1cf7

View File

@ -13,7 +13,8 @@ def is_connected():
try:
# check DNS
host = 'https://api.opwngrid.xyz/api/v1/uptime'
r = requests.get(host, headers=None, timeout=(30.0, 60.0))
headers = {'user-agent': 'pwnagotchi/%s' % pwnagotchi.__version__}
r = requests.get(host, headers=headers, timeout=(30.0, 60.0))
if r.json().get('isUp'):
return True
except: