Release.py: send a User-Agent

This commit is contained in:
sarah committed 2026-10-09 10:38:43 +02:00
1 parent e4272bd606
commit 9025865a9b
1 file changed
+2
+2
View File
@@ -51,6 +51,8 @@ def Token(Host: str) -> str:
def Api(Method: str, Url: str, TokenValue: str, Body: bytes | None = None, ContentType: str = "application/json"):
Request = urllib.request.Request(Url, data=Body, method=Method, headers={
"Authorization": f"token {TokenValue}", "Content-Type": ContentType, "Accept": "application/json",
# Cloudflare's bot check rejects Python's default User-Agent (error 1010).
"User-Agent": "SaraSuite-Release (git/2)",
})
try:
with urllib.request.urlopen(Request, timeout=300) as Response: