PY3 port responsetypes from_body

This commit is contained in:
Gregory Vigo Torres 2015-07-29 20:09:06 +02:00
parent 36ae635fbe
commit 42b8988eb2
1 changed files with 1 additions and 0 deletions

View File

@ -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():