Skip to content

Commit e5cd87c

Browse files
committed
Added an option to exclude oauth body hash from headers
1 parent a83f4a2 commit e5cd87c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oauth2/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,10 @@ def get_normalized_parameters(self):
481481
# Spaces must be encoded with "%20" instead of "+"
482482
return encoded_str.replace('+', '%20').replace('%7E', '~')
483483

484-
def sign_request(self, signature_method, consumer, token):
484+
def sign_request(self, signature_method, consumer, token, include_body_hash=True):
485485
"""Set the signature parameter to the result of sign."""
486486

487-
if not self.is_form_encoded:
487+
if not self.is_form_encoded and include_body_hash:
488488
# according to
489489
# http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html
490490
# section 4.1.1 "OAuth Consumers MUST NOT include an

0 commit comments

Comments
 (0)