From d9d548a9ccfd857362566ffb6c5b46721205b438 Mon Sep 17 00:00:00 2001 From: Mark Pellegrini Date: Fri, 20 Jun 2014 10:58:19 -0400 Subject: [PATCH] Clone headers before setting user-agent to preserve the semantics of httplib2 request method --- oauth2client/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oauth2client/client.py b/oauth2client/client.py index a3af4f8..7301dd9 100644 --- a/oauth2client/client.py +++ b/oauth2client/client.py @@ -490,10 +490,12 @@ class OAuth2Credentials(Credentials): logger.info('Attempting refresh to obtain initial access_token') self._refresh(request_orig) - # Modify the request headers to add the appropriate + # Clone and modify the request headers to add the appropriate # Authorization header. if headers is None: headers = {} + else: + headers = dict(headers) self.apply(headers) if self.user_agent is not None: