Skip to content

Commit 85fa7d7

Browse files
committed
Explicitly covert body to bytes
1 parent b94f69b commit 85fa7d7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

oauth2/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ def __init__(self, method=HTTP_METHOD, url=None, parameters=None,
355355
v = to_unicode_optional_iterator(v)
356356

357357
self[k] = v
358+
if not isinstance(body, bytes):
359+
body = body.encode('utf-8')
358360
self.body = body
359361
self.is_form_encoded = is_form_encoded
360362

0 commit comments

Comments
 (0)