mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Fix a bug when content-type is empty
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user