From 301d1a838f56c6c8e5e886b7dde3de88656cfae4 Mon Sep 17 00:00:00 2001 From: ayanamist Date: Mon, 20 Aug 2012 17:18:26 +0800 Subject: [PATCH] Fix kennethreitz/requests#790 --- requests/auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requests/auth.py b/requests/auth.py index 099ac593..d2e806ef 100644 --- a/requests/auth.py +++ b/requests/auth.py @@ -78,7 +78,8 @@ class OAuth1(AuthBase): # extract_params will not give params unless the body is a properly # formatted string, a dictionary or a list of 2-tuples. decoded_body = extract_params(r.data) - if contenttype == None and decoded_body != None: + if (contenttype is None or contenttype.lower() == "application/x-www-form-urlencoded")\ + and decoded_body != None: # extract_params can only check the present r.data and does not know # of r.files, thus an extra check is performed. We know that # if files are present the request will not have