From 7bade8f3d5badf06966b293085b88c864fdb535b Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Mon, 15 Apr 2024 18:30:39 +0800 Subject: [PATCH] Change authentication string - according to documentation, I'm supposed to prepend "token". However, swagger doesn't do that. They both do seem to work (i.e. they authenticate correctly), but adding "token " has a strange performance penalty. --- gitea-to-ics.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gitea-to-ics.py b/gitea-to-ics.py index a522678..eed2c15 100644 --- a/gitea-to-ics.py +++ b/gitea-to-ics.py @@ -20,8 +20,7 @@ def get_combined(token): req = urllib.request.Request(GITEA_REPO_URL + f"/repos/issues/search?state=open&{q}=true") req.add_header("Accept", "application/json") - req.add_header("Content-Type", "application/json") - req.add_header("Authorization", "token " + token) + req.add_header("Authorization", token) timestamp=datetime.datetime.now() print(f"{timestamp} Requesting and parsing {q}")