fix: handle empty 204 response body in Gitea API calls

This commit is contained in:
2026-05-05 00:34:33 +02:00
parent 1aa358a78f
commit a731bedad0
+4 -2
View File
@@ -208,7 +208,8 @@ jobs:
},
)
with urllib.request.urlopen(req) as resp:
return json.loads(resp.read().decode("utf-8"))
raw = resp.read()
return json.loads(raw) if raw else {}
def upload_asset(rid, path, auth_scheme):
p = Path(path)
@@ -231,7 +232,8 @@ jobs:
},
)
with urllib.request.urlopen(req) as resp:
return json.loads(resp.read().decode("utf-8"))
raw = resp.read()
return json.loads(raw) if raw else {}
auth_scheme = None
last_error = None