API: Use session.headers.update method to add user-agent header.

Directly assigning session.headers overrides the default header
paramers and removes `{'Accept-Encoding': 'gzip, deflate'}` from
the headers.
This commit is contained in:
amanagr 2018-03-31 01:17:34 +05:30 committed by Tim Abbott
parent e49ecfcd39
commit aa5df127ae

View file

@ -414,7 +414,7 @@ class Client(object):
session.auth = requests.auth.HTTPBasicAuth(self.email, self.api_key)
session.verify = self.tls_verification # type: ignore # https://github.com/python/typeshed/pull/1504
session.cert = client_cert
session.headers = {"User-agent": self.get_user_agent()}
session.headers.update({"User-agent": self.get_user_agent()})
self.session = session
def get_user_agent(self):