We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Bearer None
1 parent 73a72cc commit 582e48fCopy full SHA for 582e48f
1 file changed
src/fastapi_cloud_cli/utils/api.py
@@ -209,13 +209,14 @@ def __init__(self, use_deploy_token: bool = False) -> None:
209
token = identity.user_token
210
self.auth_mode = "user"
211
212
+ headers = {"User-Agent": f"fastapi-cloud-cli/{__version__}"}
213
+ if token:
214
+ headers["Authorization"] = f"Bearer {token}"
215
+
216
super().__init__(
217
base_url=settings.base_api_url,
218
timeout=httpx.Timeout(20),
- headers={
- "Authorization": f"Bearer {token}",
- "User-Agent": f"fastapi-cloud-cli/{__version__}",
- },
219
+ headers=headers,
220
)
221
222
@attempts(STREAM_LOGS_MAX_RETRIES, STREAM_LOGS_TIMEOUT)
0 commit comments