Changed the mimetype detection code to only read first 4k block of file, not the whole file.

- Legacy-Id: 5878
This commit is contained in:
Henrik Levkowetz 2013-07-25 18:28:18 +00:00
parent a8c2bc80e9
commit 1e03a04eca

View file

@ -32,7 +32,7 @@ class PlainParser(FileParser):
def parse_file_charset(self):
import magic
self.fd.file.seek(0)
content = self.fd.file.read()
content = self.fd.file.read(4096)
if hasattr(magic, "open"):
m = magic.open(magic.MAGIC_MIME)
m.load()