fix: correct user socket path
This commit is contained in:
parent
11637c9143
commit
5c64286b70
1 changed files with 2 additions and 2 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue