From b8bf8810318d30285840f2631e359cffbf8114a7 Mon Sep 17 00:00:00 2001 From: Ilya Vishnevsky Date: Tue, 7 Feb 2017 15:47:17 +0300 Subject: [PATCH] a tiny workaround for httplib2 redirect bug --- oauth2/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oauth2/__init__.py b/oauth2/__init__.py index a1776a75..b4c0e23a 100644 --- a/oauth2/__init__.py +++ b/oauth2/__init__.py @@ -651,6 +651,9 @@ def request(self, uri, method="GET", body=b'', headers=None, redirections=httplib2.DEFAULT_MAX_REDIRECTS, connection_type=None): DEFAULT_POST_CONTENT_TYPE = 'application/x-www-form-urlencoded' + if body is None: + body = b'' + if not isinstance(headers, dict): headers = {}