Skip to content

Commit 29eee7d

Browse files
committed
add autogenerated client
1 parent a28ab40 commit 29eee7d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fishjam/_openapi_client/client.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,6 @@ class AuthenticatedClient:
193193
prefix: str = "Bearer"
194194
auth_header_name: str = "Authorization"
195195

196-
api_prefix: str = "python-server"
197-
api_header_name: str = "x-fishjam-api-client"
198-
199196
def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient":
200197
"""Get a new client matching this one with additional headers"""
201198
if self._client is not None:
@@ -234,7 +231,7 @@ def get_httpx_client(self) -> httpx.Client:
234231
self._headers[self.auth_header_name] = (
235232
f"{self.prefix} {self.token}" if self.prefix else self.token
236233
)
237-
self._headers[self.api_header_name] = f"{self.api_prefix}-{get_version()}"
234+
self._headers["x-fishjam-api-client"] = f"python-server-{get_version()}"
238235
self._client = httpx.Client(
239236
base_url=self._base_url,
240237
cookies=self._cookies,
@@ -271,7 +268,7 @@ def get_async_httpx_client(self) -> httpx.AsyncClient:
271268
self._headers[self.auth_header_name] = (
272269
f"{self.prefix} {self.token}" if self.prefix else self.token
273270
)
274-
self._headers[self.api_header_name] = f"{self.api_prefix}-{get_version()}"
271+
self._headers["x-fishjam-api-client"] = f"python-server-{get_version()}"
275272
self._async_client = httpx.AsyncClient(
276273
base_url=self._base_url,
277274
cookies=self._cookies,

0 commit comments

Comments
 (0)