Make sure content_type is stripped of whitespace.
Otherwise the not_binary method will not match. I considered stripping in not_binary but I think it is better that it be strict in what it accepts.
This commit is contained in:
parent
59ad05476a
commit
27eb9b2d89
@ -53,7 +53,8 @@ def decode_content(response, content):
|
||||
'application/binary').strip().lower()
|
||||
charset = 'utf-8'
|
||||
if ';' in content_type:
|
||||
content_type, parameter_strings = content_type.split(';', 1)
|
||||
content_type, parameter_strings = (attr.strip() for attr
|
||||
in content_type.split(';', 1))
|
||||
try:
|
||||
parameter_pairs = [atom.strip().split('=')
|
||||
for atom in parameter_strings.split(';')]
|
||||
|
Loading…
x
Reference in New Issue
Block a user