From 3e5dbbd6cd2068d5ddb5e5d758f0249f99566932 Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Sat, 28 Jun 2025 23:08:31 +0300 Subject: [PATCH] feat: extend user-agent --- src/ahriman/core/http/sync_http_client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ahriman/core/http/sync_http_client.py b/src/ahriman/core/http/sync_http_client.py index 39506dd1..7e0949b3 100644 --- a/src/ahriman/core/http/sync_http_client.py +++ b/src/ahriman/core/http/sync_http_client.py @@ -18,6 +18,7 @@ # along with this program. If not, see . # import requests +import sys from functools import cached_property from typing import Any, IO, Literal @@ -70,7 +71,10 @@ class SyncHttpClient(LazyLogging): request.Session: created session object """ session = requests.Session() - session.headers["User-Agent"] = f"ahriman/{__version__}" + python_version = ".".join(map(str, sys.version_info[:3])) # just major.minor.patch + session.headers["User-Agent"] = f"ahriman/{__version__}" \ + f"{requests.utils.default_user_agent()}" \ + f"python/{python_version}" return session