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:
parent
a8c2bc80e9
commit
1e03a04eca
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue