Closed jjlee closed 14 years ago
From Felix Heß
trying to read www.cortalconsors.de with mechanize fails. The problem is in _http.py in the function http_response (line 197). Calling
ct_hdrs = http_message.getheaders("content-type")
returns [''] sometimes. Then is_html(ct_hdrs, url, self._allow_xhtml) fails.
proposed bugfix:
if '' in ct_hdrs: ct_hdrs.remove('')
before calling
if is_html(ct_hdrs, url, self._allow_xhtml):
I hope this information helps you to resolve the bug.
Best regards Felix
Fix IndexError on empty Content-type header value
Closed by 346c364f1991ee416b6dddf579f85b74b51d28d3
From Felix Heß
trying to read www.cortalconsors.de with mechanize fails. The problem is in _http.py in the function http_response (line 197). Calling
ct_hdrs = http_message.getheaders("content-type")
returns [''] sometimes. Then is_html(ct_hdrs, url, self._allow_xhtml) fails.
proposed bugfix:
before calling
if is_html(ct_hdrs, url, self._allow_xhtml):
I hope this information helps you to resolve the bug.
Best regards Felix