Skip to content

Commit 025867a

Browse files
authored
fix: add gcloud-python header to user agent (#9551)
* fix: add gcloud-python header to user agent
1 parent de3abdf commit 025867a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

storage/google/cloud/storage/_http.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ def __init__(self, client, client_info=None, api_endpoint=DEFAULT_API_ENDPOINT):
3636
self.API_BASE_URL = api_endpoint
3737
self._client_info.client_library_version = __version__
3838

39+
# TODO: When metrics all use gccl, this should be removed #9552
40+
if self._client_info.user_agent is None: # pragma: no branch
41+
self._client_info.user_agent = ""
42+
self._client_info.user_agent += " gcloud-python/{} ".format(__version__)
43+
3944
API_VERSION = "v1"
4045
"""The version of the API, used in building the API call's URL."""
4146

0 commit comments

Comments
 (0)