fix: correct user socket path

This commit is contained in:
Alpha Nerd 2026-04-17 13:31:19 +02:00
parent 11637c9143
commit 5c64286b70
Signed by: alpha-nerd
SSH key fingerprint: SHA256:QkkAgVoYi9TQ0UKPkiKSfnerZy2h4qhi3SVPXJmBN+M

View file

@ -514,10 +514,10 @@ def _is_unix_socket_endpoint(endpoint: str) -> bool:
def _get_socket_path(endpoint: str) -> str: def _get_socket_path(endpoint: str) -> str:
"""Derive Unix socket file path from a .sock endpoint URL. """Derive Unix socket file path from a .sock endpoint URL.
http://192.168.0.52.sock/v1 -> /tmp/192.168.0.52.sock http://192.168.0.52.sock/v1 -> /run/user/<uid>/192.168.0.52.sock
""" """
host = endpoint.split("//", 1)[1].split("/")[0].split(":")[0] host = endpoint.split("//", 1)[1].split("/")[0].split(":")[0]
return f"/tmp/{host}" return f"/run/user/{os.getuid()}/{host}"
def get_session(endpoint: str) -> aiohttp.ClientSession: def get_session(endpoint: str) -> aiohttp.ClientSession: