Skip to content

Commit 6b89457

Browse files
committed
refactor (sdk) refactor user agent to be string parseable
1 parent e00dff1 commit 6b89457

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

staxapp/api.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@ class Api:
1313
def _headers(cls, custom_headers) -> dict:
1414
headers = {
1515
**custom_headers,
16-
"User-Agent": json.dumps(
17-
{
18-
"platform": Config.platform,
19-
"python_version": Config.python_version,
20-
"sdk_version": Config.sdk_version,
21-
}
22-
),
16+
"User-Agent": f"platform/{Config.platform} python/{Config.python_version} sdk/{Config.sdk_version}",
2317
}
2418
return headers
2519

staxapp/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class Config:
3434
expiration = None
3535
load_live_schema = True
3636

37-
platform = (sysinfo.platform(),)
38-
python_version = (sysinfo.python_version(),)
39-
sdk_version = (staxapp.__version__,)
37+
platform = sysinfo.platform()
38+
python_version = sysinfo.python_version()
39+
sdk_version = staxapp.__version__
4040

4141
@classmethod
4242
def set_config(cls):

0 commit comments

Comments
 (0)