Skip to content

Commit e2234fd

Browse files
Merge pull request #1086 from planetlabs/steve/sync-user-agent
update user agent for sync client
2 parents e3aa242 + eb94132 commit e2234fd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

planet/sync/client.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from .orders import OrdersAPI
44
from .subscriptions import SubscriptionsAPI
55
from planet.http import Session
6+
from planet.__version__ import __version__
67

7-
SYNC_CLIENT_AGENT = "python-sdk-sync"
8+
SYNC_CLIENT_X_PLANET_APP = "python-sdk-sync"
89

910

1011
class Planet:
@@ -42,8 +43,12 @@ class Planet:
4243

4344
def __init__(self, session: Optional[Session] = None) -> None:
4445
self._session = session or Session()
45-
self._session._client.headers.update(
46-
{"X-Planet-App": SYNC_CLIENT_AGENT})
46+
self._session._client.headers.update({
47+
"X-Planet-App":
48+
SYNC_CLIENT_X_PLANET_APP,
49+
"User-Agent":
50+
f"planet-client-python/{__version__}/sync"
51+
})
4752

4853
self.data = DataAPI(self._session)
4954
self.orders = OrdersAPI(self._session)

0 commit comments

Comments
 (0)