mirror of https://github.com/scrapy/scrapy.git
PY3 port responsetypes from_body
This commit is contained in:
parent
36ae635fbe
commit
42b8988eb2
|
|
@ -90,6 +90,7 @@ class ResponseTypes(object):
|
|||
it's not meant to be used except for special cases where response types
|
||||
cannot be guess using more straightforward methods."""
|
||||
chunk = body[:5000]
|
||||
chunk = to_bytes(chunk)
|
||||
if isbinarytext(chunk):
|
||||
return self.from_mimetype('application/octet-stream')
|
||||
elif b"<html>" in chunk.lower():
|
||||
|
|
|
|||
Loading…
Reference in New Issue