Skip to content

Commit cf9c640

Browse files
committed
sent sdk version in headers
1 parent 2d1e746 commit cf9c640

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fishjam/_openapi_client/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import httpx
55
from attrs import define, evolve, field
66

7+
from fishjam.version import get_version
8+
79

810
@define
911
class Client:
@@ -229,6 +231,7 @@ def get_httpx_client(self) -> httpx.Client:
229231
self._headers[self.auth_header_name] = (
230232
f"{self.prefix} {self.token}" if self.prefix else self.token
231233
)
234+
self._headers["x-sdk_version"] = f"py-{get_version()}"
232235
self._client = httpx.Client(
233236
base_url=self._base_url,
234237
cookies=self._cookies,
@@ -265,6 +268,7 @@ def get_async_httpx_client(self) -> httpx.AsyncClient:
265268
self._headers[self.auth_header_name] = (
266269
f"{self.prefix} {self.token}" if self.prefix else self.token
267270
)
271+
self._headers["x-sdk_version"] = f"py-{get_version()}"
268272
self._async_client = httpx.AsyncClient(
269273
base_url=self._base_url,
270274
cookies=self._cookies,

0 commit comments

Comments
 (0)