File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717from ..core .errors import *
1818from ..core import error_codes as ec
1919
20+ from ..__version__ import __version__ as _SDK_VERSION
2021
22+
23+ _USER_AGENT = f"DataverseSvcPythonClient:{ _SDK_VERSION } "
2124_GUID_RE = re .compile (r"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" )
2225
2326
@@ -58,14 +61,13 @@ def _headers(self) -> Dict[str, str]:
5861 """Build standard OData headers with bearer auth."""
5962 scope = f"{ self .base_url } /.default"
6063 token = self .auth .acquire_token (scope ).access_token
61- # TODO: add version to User-Agent
6264 return {
6365 "Authorization" : f"Bearer { token } " ,
6466 "Accept" : "application/json" ,
6567 "Content-Type" : "application/json" ,
6668 "OData-MaxVersion" : "4.0" ,
6769 "OData-Version" : "4.0" ,
68- "User-Agent" : "DataversePythonSDK" ,
70+ "User-Agent" : _USER_AGENT ,
6971 }
7072
7173 def _merge_headers (self , headers : Optional [Dict [str , str ]] = None ) -> Dict [str , str ]:
You can’t perform that action at this time.
0 commit comments