Skip to content

Commit fd70b28

Browse files
committed
Merge pull request googleapis#19 from uguatel/master
Clone headers before setting user-agent to preserve the semantics of httplib2 request method
2 parents 3c5f813 + d9d548a commit fd70b28

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

oauth2client/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,12 @@ def new_request(uri, method='GET', body=None, headers=None,
490490
logger.info('Attempting refresh to obtain initial access_token')
491491
self._refresh(request_orig)
492492

493-
# Modify the request headers to add the appropriate
493+
# Clone and modify the request headers to add the appropriate
494494
# Authorization header.
495495
if headers is None:
496496
headers = {}
497+
else:
498+
headers = dict(headers)
497499
self.apply(headers)
498500

499501
if self.user_agent is not None:

0 commit comments

Comments
 (0)