Skip to content

Commit

Permalink
fixed oauth header generation to only include oauth params
Browse files Browse the repository at this point in the history
  • Loading branch information
benadida committed Sep 2, 2008
1 parent 3fecfb9 commit 540b969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions base/oauth.py
Expand Up @@ -99,6 +99,9 @@ class OAuthRequest(object):
http_method = HTTP_METHOD
http_url = None
version = VERSION

# added by Ben to filter out extra params from header
OAUTH_PARAMS = ['oauth_consumer_key', 'oauth_token', 'oauth_signature_method', 'oauth_signature', 'oauth_timestamp', 'oauth_nonce', 'oauth_version']

def __init__(self, http_method=HTTP_METHOD, http_url=None, parameters=None):
self.http_method = http_method
Expand Down Expand Up @@ -132,6 +135,8 @@ def to_header(self, realm=''):
# add the oauth parameters
if self.parameters:
for k, v in self.parameters.iteritems():
# only if it's a standard OAUTH param (Ben)
if k in self.OAUTH_PARAMS:
auth_header += ', %s="%s"' % (k, escape(str(v)))
return {'Authorization': auth_header}

Expand Down
2 changes: 1 addition & 1 deletion index.yaml
Expand Up @@ -10,7 +10,7 @@ indexes:
# automatically uploaded to the admin console when you next deploy
# your application using appcfg.py.

# Used 77 times in query history.
# Used 80 times in query history.
- kind: ElectionExponent
properties:
- name: election
Expand Down

0 comments on commit 540b969

Please sign in to comment.