diff --git a/AUTHORS b/AUTHORS index 1eabf651..8497a09c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -42,3 +42,4 @@ Patches and Suggestions - Alejandro Giacometti - Rick Mak - Johan Bergström +- Josselin Jacquard diff --git a/requests/utils.py b/requests/utils.py index d21966cd..27423ee6 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -150,8 +150,10 @@ def get_encoding_from_headers(headers): """ content_type = headers.get('content-type') - if not content_type : - return + + if not content_type: + return None + content_type, params = cgi.parse_header(content_type) if 'charset' in params: