From 8f8e18b7dc3cb2f50d7354bbb496cdb5ce6c205f Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Fri, 29 Aug 2014 13:34:07 -0400 Subject: [PATCH] Handle empty response from server If the server returns an empty string, we should still raise an OAuthException. --- flask_oauthlib/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_oauthlib/client.py b/flask_oauthlib/client.py index 5a34d74e..1a6eefcc 100644 --- a/flask_oauthlib/client.py +++ b/flask_oauthlib/client.py @@ -536,7 +536,7 @@ def generate_request_token(self, callback=None): type='token_generation_failed' ) data = parse_response(resp, content) - if data is None: + if not data: raise OAuthException( 'Invalid token response from %s' % self.name, type='token_generation_failed'