fix: use httpx query parameters to correctly URL encode since timestamp

This commit is contained in:
Michael
2026-06-30 22:10:34 +02:00
parent 9fb56315c6
commit 071c2a522d
2 changed files with 33 additions and 3 deletions
+4 -3
View File
@@ -400,10 +400,11 @@ class GiteaClient(IssuesClient, PullRequestsClient, FilesClient, RefsClient, Rep
def list_unread_notifications(self, since: Optional[str] = None) -> list[dict[str, Any]]:
try:
with httpx.Client() as client:
url = f"{self.base_url}/api/v1/notifications?all=false"
url = f"{self.base_url}/api/v1/notifications"
params: dict[str, str] = {"all": "false"}
if since:
url += f"&since={since}"
response = client.get(url, headers=self.headers)
params["since"] = since
response = client.get(url, headers=self.headers, params=params)
response.raise_for_status()
notifications: list[dict[str, Any]] = response.json()