diff --git a/scrapy/responsetypes.py b/scrapy/responsetypes.py index 7c017feef..c212f5706 100644 --- a/scrapy/responsetypes.py +++ b/scrapy/responsetypes.py @@ -92,9 +92,9 @@ class ResponseTypes(object): chunk = body[:5000] if isbinarytext(chunk): return self.from_mimetype('application/octet-stream') - elif "" in chunk.lower(): + elif b"" in chunk.lower(): return self.from_mimetype('text/html') - elif " %s != %s" % (source, retcls, cls) - + def test_from_headers(self): mappings = [ ({'Content-Type': ['text/html; charset=utf-8']}, HtmlResponse),