Skip to content

Commit

Permalink
Sign querystring parameters in OAuth 1.0
Browse files Browse the repository at this point in the history
Existing usage doesn't pass GET querystring parameters along to oauthlib,
so it wasn't signing those properly, which causes problems with APIs that
rely heavily on GET parameters. By passing in r.full_url instead of r.url,
oauthlib can parse out the correct parameters and sign them properly.
  • Loading branch information
gulopine committed Jun 19, 2012
1 parent 9a30e02 commit 4e568c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions requests/auth.py
Expand Up @@ -83,12 +83,12 @@ def __call__(self, r):
# to preserve body.
r.headers['Content-Type'] = 'multipart/form-encoded'
r.url, r.headers, _ = self.client.sign(
unicode(r.url), unicode(r.method), None, r.headers)
unicode(r.full_url), unicode(r.method), None, r.headers)
else:
# Normal signing
r.headers['Content-Type'] = 'application/x-www-form-urlencoded'
r.url, r.headers, r.data = self.client.sign(
unicode(r.url), unicode(r.method), r.data, r.headers)
unicode(r.full_url), unicode(r.method), r.data, r.headers)

# Having the authorization header, key or value, in unicode will
# result in UnicodeDecodeErrors when the request is concatenated
Expand Down

0 comments on commit 4e568c1

Please sign in to comment.