GAM User-Agent header for service account requests

This commit is contained in:
Jay Lee
2017-12-20 19:01:36 -05:00
parent 46d655b328
commit 5318a7a9da
2 changed files with 9 additions and 2 deletions

View File

@ -1015,7 +1015,7 @@ def buildGAPIServiceObject(api, act_as, showAuthError=True):
request = google_auth_httplib2.Request(http)
try:
credentials.refresh(request)
service._http = google_auth_httplib2.AuthorizedHttp(credentials, http=http)
service._http = google_auth_httplib2.AuthorizedHttp(credentials, http=http, user_agent=GAM_INFO)
except httplib2.ServerNotFoundError as e:
systemErrorExit(4, e)
except google.auth.exceptions.RefreshError as e: