Skip to content

Specification improvement and bug fix to sign_request #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

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