Skip to content

Commit d4b0b6d

Browse files
committed
encoded to utf-8
1 parent 46bbc5e commit d4b0b6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

oauth2/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,9 @@ def sign_request(self, signature_method, consumer, token):
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
491491
# oauth_body_hash parameter on requests with form-encoded
492-
# request bodies. "
492+
# request bodies."
493+
if not self.body:
494+
self.body = ''.encode('utf-8')
493495
self['oauth_body_hash'] = base64.b64encode(sha1(self.body).digest())
494496

495497
if 'oauth_consumer_key' not in self:

0 commit comments

Comments
 (0)