_headers missing, fixed

This commit is contained in:
2026-04-04 16:52:27 +02:00
parent 9cc1b695bd
commit 1907e97049
2 changed files with 117 additions and 0 deletions

10
ota.py
View File

@@ -87,6 +87,16 @@ def info(msg): _log("INFO", msg)
def warn(msg): _log("WARN", msg)
def log_err(msg): _log("ERROR", msg)
# ---------------------------------------------------------------------------
# HTTP helpers
# ---------------------------------------------------------------------------
def _headers():
h = {"Accept": "application/json"}
if API_TOKEN:
h["Authorization"] = f"token {API_TOKEN}"
return h
# ---------------------------------------------------------------------------
# Config loader
# ---------------------------------------------------------------------------