From 4e568c18991fb033290375f467b74384da10a60b Mon Sep 17 00:00:00 2001 From: Marty Alchin Date: Mon, 18 Jun 2012 21:02:51 -0700 Subject: [PATCH] Sign querystring parameters in OAuth 1.0 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. --- requests/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requests/auth.py b/requests/auth.py index 314f7934..2ae27031 100644 --- a/requests/auth.py +++ b/requests/auth.py @@ -83,12 +83,12 @@ class OAuth1(AuthBase): # 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