Skip to content

Commit ceac2ca

Browse files
committed
✨ Add custom user agent
1 parent c39c3fd commit ceac2ca

File tree

1 file changed

+6
-1
lines changed
  • src/fastapi_cloud_cli/utils

1 file changed

+6
-1
lines changed

src/fastapi_cloud_cli/utils/api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import httpx
22

3+
from fastapi_cloud_cli import __version__
34
from fastapi_cloud_cli.config import settings
45

56
from .auth import get_auth_token
@@ -10,5 +11,9 @@ def __init__(self) -> None:
1011
token = get_auth_token()
1112

1213
super().__init__(
13-
base_url=settings.base_api_url, headers={"Authorization": f"Bearer {token}"}
14+
base_url=settings.base_api_url,
15+
headers={
16+
"Authorization": f"Bearer {token}",
17+
"User-Agent": f"fastapi-cloud-cli/{__version__}",
18+
},
1419
)

0 commit comments

Comments
 (0)