From 1ecb593c7be7d6465cf61356f3bdada3849b84fd Mon Sep 17 00:00:00 2001 From: Josselin Jacquard Date: Tue, 30 Aug 2011 12:04:48 +0200 Subject: [PATCH] Fix a bug when content-type is empty --- requests/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requests/utils.py b/requests/utils.py index 8db2cb55..d21966cd 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -150,6 +150,8 @@ def get_encoding_from_headers(headers): """ content_type = headers.get('content-type') + if not content_type : + return content_type, params = cgi.parse_header(content_type) if 'charset' in params: