S310: fix

This commit is contained in:
Jörg Thalheim
2025-08-20 16:10:00 +02:00
parent 0a70ed6268
commit 4852e79c3c
2 changed files with 13 additions and 12 deletions

View File

@@ -84,8 +84,9 @@ class ZerotierController:
headers["Content-Type"] = "application/json"
headers["X-ZT1-AUTH"] = self.authtoken
url = f"http://127.0.0.1:{self.port}{path}"
req = urllib.request.Request(url, headers=headers, method=method, data=body)
resp = urllib.request.urlopen(req)
# Safe: only connecting to localhost zerotier API
req = urllib.request.Request(url, headers=headers, method=method, data=body) # noqa: S310
resp = urllib.request.urlopen(req) # noqa: S310
return json.load(resp)
def status(self) -> dict[str, Any]: