Skip to content
Myr

Sign querystring parameters in OAuth 1.0

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by Marty Alchin · committed by Marty Alchin · parent 9a30e02 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:requests/auth.py+2 added-2 removed
81 unmodified lines
82 # be empty (cant add paras to body if multipart) and we wish83 # to preserve body. 84 r.headers['Content-Type'] = 'multipart/form-encoded'85 r.url, r.headers, _ = self.client.sign(86 unicode(r.url), unicode(r.method), None, r.headers)86 unicode(r.full_url), unicode(r.method), None, r.headers)87 else:88 # Normal signing89 r.headers['Content-Type'] = 'application/x-www-form-urlencoded'90 r.url, r.headers, r.data = self.client.sign(91 unicode(r.url), unicode(r.method), r.data, r.headers)91 unicode(r.full_url), unicode(r.method), r.data, r.headers)9293 # Having the authorization header, key or value, in unicode will94 # result in UnicodeDecodeErrors when the request is concatenated95 # by httplib. This can easily be seen when attaching files.
134 unmodified lines