python-oauth2 icon indicating copy to clipboard operation
python-oauth2 copied to clipboard

httplib2 redirect bug

Open ivishnevs opened this issue 8 years ago • 2 comments

if 'location' header is in response object, http2lib try to redirect and use self.request method with body=None argument; this behavior implies a problem like this - https://github.com/joestump/python-oauth2/issues/203 and etc.

if response.status in [302, 303]:
    redirect_method = "GET"
    body = None    <--------- 

(response, content) = self.request(
               location, method=redirect_method, body=body,
               headers=headers, redirections=redirections - 1)
File "/Users/speedingdeer/code/.../pyvenv3.4/lib/python3.4/site-packages/oauth2/init.py", line 493, in sign_request
self['oauth_body_hash'] = base64.b64encode(sha1(self.body).digest())
TypeError: object supporting the buffer API required

ivishnevs avatar Feb 08 '17 08:02 ivishnevs

It's a tiny workaround for this issue

ivishnevs avatar Feb 08 '17 08:02 ivishnevs

@joestump what do you think about it?

ivishnevs avatar Feb 23 '17 14:02 ivishnevs