Change authentication string
All checks were successful
buildbot/multibuild_parent Build done.
buildbot/travis_bionic Build done.

- 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.
This commit is contained in:
Peter Šurda 2024-04-15 18:30:39 +08:00
parent 83b9276375
commit 7bade8f3d5
Signed by: PeterSurda
GPG Key ID: 3E47497CF67ABB95

View File

@ -20,8 +20,7 @@ def get_combined(token):
req = urllib.request.Request(GITEA_REPO_URL req = urllib.request.Request(GITEA_REPO_URL
+ f"/repos/issues/search?state=open&{q}=true") + f"/repos/issues/search?state=open&{q}=true")
req.add_header("Accept", "application/json") req.add_header("Accept", "application/json")
req.add_header("Content-Type", "application/json") req.add_header("Authorization", token)
req.add_header("Authorization", "token " + token)
timestamp=datetime.datetime.now() timestamp=datetime.datetime.now()
print(f"{timestamp} Requesting and parsing {q}") print(f"{timestamp} Requesting and parsing {q}")