Created
June 11, 2011 02:53
-
-
Save espeed/1020196 to your computer and use it in GitHub Desktop.
Patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From ce55883e1009c70108bd7503e89c896bb8838fe1 Mon Sep 17 00:00:00 2001 | |
From: James Thornton <james@jamesthornton.com> | |
Date: Fri, 10 Jun 2011 21:44:19 -0500 | |
Subject: [PATCH] Setting self.body to None breaks oauth2/init.py line 493. | |
Changed the body default from None to empty string. | |
--- | |
flaskext/oauth.py | 6 +++--- | |
1 files changed, 3 insertions(+), 3 deletions(-) | |
diff --git a/flaskext/oauth.py b/flaskext/oauth.py | |
index 504b479..d3068fd 100644 | |
--- a/flaskext/oauth.py | |
+++ b/flaskext/oauth.py | |
@@ -199,7 +199,7 @@ class OAuthRemoteApp(object): | |
""" | |
return oauth2.Client(self._consumer, self.get_request_token()) | |
- def request(self, url, data=None, headers=None, format='urlencoded', | |
+ def request(self, url, data='', headers=None, format='urlencoded', | |
method='GET', content_type=None): | |
"""Sends a request to the remote server with OAuth tokens attached. | |
The `url` is joined with :attr:`base_url` if the URL is relative. | |
@@ -225,9 +225,9 @@ class OAuthRemoteApp(object): | |
url = self.expand_url(url) | |
if method == 'GET': | |
assert format == 'urlencoded' | |
- if data is not None: | |
+ if not data: | |
url = add_query(url, data) | |
- data = None | |
+ data = '' | |
else: | |
if content_type is None: | |
data, content_type = encode_request_data(data, format) | |
-- | |
1.7.4.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment