Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit f0765d0

Browse files
committed
fix: use headers and base_url from client config
1 parent 50d4910 commit f0765d0

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

postgrest/_async/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def create_session(
5454
client: Union[AsyncClient, None] = None,
5555
) -> AsyncClient:
5656
if client is not None:
57+
client.base_url = base_url
58+
client.headers = headers
5759
return client
5860

5961
return AsyncClient(

postgrest/_sync/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def create_session(
5454
client: Union[SyncClient, None] = None,
5555
) -> SyncClient:
5656
if client is not None:
57+
client.base_url = base_url
58+
client.headers = headers
5759
return client
5860

5961
return SyncClient(

postgrest/base_client.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def __init__(
2020
timeout: Union[int, float, Timeout],
2121
verify: bool = True,
2222
proxy: Optional[str] = None,
23+
client: Union[SyncClient, AsyncClient, None] = None,
2324
) -> None:
2425
if not is_http_url(base_url):
2526
ValueError("base_url must be a valid HTTP URL string")
@@ -33,8 +34,14 @@ def __init__(
3334
self.timeout = timeout
3435
self.verify = verify
3536
self.proxy = proxy
37+
self.client = client
3638
self.session = self.create_session(
37-
self.base_url, self.headers, self.timeout, self.verify, self.proxy
39+
self.base_url,
40+
self.headers,
41+
self.timeout,
42+
self.verify,
43+
self.proxy,
44+
self.client,
3845
)
3946

4047
@abstractmethod

0 commit comments

Comments
 (0)