Sign requests even if they have no body data.
authorMatt McClure <matt.mcclure@mapmyfitness.com>
Tue, 27 Nov 2012 18:12:21 +0000 (13:12 -0500)
committerMatt McClure <matt.mcclure@mapmyfitness.com>
Tue, 27 Nov 2012 18:12:21 +0000 (13:12 -0500)
requests/auth.py

index b662397e77135b0ada307add8d5361e999cfd93f..f86c0ccd7b73b9f29cb0e99ec5d657230501090c 100644 (file)
@@ -105,7 +105,7 @@ class OAuth1(AuthBase):
                                                         unicode(r.method),
                                                         r.data,
                                                         r.headers)
-        elif r.data:
+        else:
             # The data we passed was either definitely not urlencoded
             # (because extract_params returned nothing) or doesn't have a
             # content header that assures us that it is. Assume then that the
@@ -114,8 +114,6 @@ class OAuth1(AuthBase):
                                                    unicode(r.method),
                                                    None,
                                                    r.headers)
-        else:
-            _oauth_signed = False
         if _oauth_signed:
             # Both flows add params to the URL by using r.full_url,
             # so this prevents adding it again later