Skip to content

Conversation

rickhanlonii
Copy link
Collaborator

Overview

Reopening #138 against develop.

Per the OAuth Body Hash specifications (3.2)[1], if there is no body entity, then the hash should be done over the empty string.  
  
Also, when httplib2 handles a redirect, the follow is performed with None as the request body. This causes a TypeError to be thrown when attempting to hash the body here.  
  
This commit fixes the bug while improving the specification alignment.  
  
[1]http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html
Per the OAuth Body Hash specifications (3.2)[1], if there is no body entity, then the hash should be done over the empty string.  
  
Also, when httplib2 handles a redirect, the follow is performed with None as the request body. This causes a TypeError to be thrown when attempting to hash the body here.  
  
This commit fixes the bug while improving the specification alignment.  
  
[1]http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html
@@ -485,8 +485,14 @@ def sign_request(self, signature_method, consumer, token):
"""Set the signature parameter to the result of sign."""

if not self.is_form_encoded:
# according to
# according to

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • W291 trailing whitespace

@TimSC
Copy link
Contributor

TimSC commented Jan 13, 2018

I pulled this PR into a new fork: https://github.com/TimSC/python-oauth10a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants