Skip to content

Commit 1ef66a6

Browse files
added origin param
2 parents 2c1d30d + 8c67948 commit 1ef66a6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/murf/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import typing
44
import os
55
import httpx
6+
from .version import __version__
67

78
class Murf(BaseClient):
89
"""
@@ -51,6 +52,10 @@ def __init__(
5152
follow_redirects: typing.Optional[bool] = True,
5253
httpx_client: typing.Optional[httpx.Client] = None,
5354
):
55+
default_params = {'origin': f'python_sdk_{__version__}'}
56+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
57+
httpx_client=httpx_client if httpx_client is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout)
58+
5459
super().__init__(
5560
base_url=base_url,
5661
environment=environment,
@@ -109,6 +114,10 @@ def __init__(
109114
follow_redirects: typing.Optional[bool] = True,
110115
httpx_client: typing.Optional[httpx.AsyncClient] = None,
111116
):
117+
default_params = {'origin': f'python_sdk_{__version__}'}
118+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
119+
httpx_client=httpx_client if httpx_client is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout)
120+
112121
super().__init__(
113122
base_url=base_url,
114123
environment=environment,

0 commit comments

Comments
 (0)