Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: auth.py

Issue 1082133002: Fix typo in Authorization header name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: auth.py
diff --git a/auth.py b/auth.py
index 789db6a4f45670e9a3b5cb28cab26de1a8f6d364..66137b5924c54ee1934a287600da9b6434ed1886 100644
--- a/auth.py
+++ b/auth.py
@@ -329,13 +329,13 @@ class Authenticator(object):
redirections=httplib2.DEFAULT_MAX_REDIRECTS,
connection_type=None):
headers = (headers or {}).copy()
- headers['Authorizaton'] = 'Bearer %s' % self.get_access_token().token
+ headers['Authorization'] = 'Bearer %s' % self.get_access_token().token
resp, content = request_orig(
uri, method, body, headers, redirections, connection_type)
if resp.status in client.REFRESH_STATUS_CODES:
logging.info('Refreshing due to a %s', resp.status)
access_token = self.get_access_token(force_refresh=True)
- headers['Authorizaton'] = 'Bearer %s' % access_token.token
+ headers['Authorization'] = 'Bearer %s' % access_token.token
return request_orig(
uri, method, body, headers, redirections, connection_type)
else:
@@ -358,7 +358,7 @@ class Authenticator(object):
return None
if not credentials.access_token or credentials.access_token_expired:
return None
- return AccessToken(credentials.access_token, credentials.token_expiry)
+ return AccessToken(str(credentials.access_token), credentials.token_expiry)
def _create_access_token(self, allow_user_interaction=False):
"""Mints and caches a new access token, launching OAuth2 dance if necessary.
@@ -405,7 +405,7 @@ class Authenticator(object):
credentials.token_expiry - datetime.datetime.utcnow())
credentials.set_store(storage)
storage.put(credentials)
- return AccessToken(credentials.access_token, credentials.token_expiry)
+ return AccessToken(str(credentials.access_token), credentials.token_expiry)
## Private functions.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698