This commit is contained in:
Marcel Heers 2021-03-15 15:50:19 +01:00
parent 233d33428d
commit 7c96c87590

View File

@ -167,7 +167,8 @@ func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error {
case strings.HasPrefix(mimetype, "image"): case strings.HasPrefix(mimetype, "image"):
i.Type = "image" i.Type = "image"
return nil return nil
case (strings.HasPrefix(mimetype, "text") || strings.HasSuffix(mimetype, "json") || (len(buffer) > 0 && !isBinary(buffer))) && i.Size <= 10*1024*1024: // 10 MB case (strings.HasPrefix(mimetype, "text") || strings.HasSuffix(mimetype, "json") ||
(len(buffer) > 0 && !isBinary(buffer))) && i.Size <= 10*1024*1024: // 10 MB
i.Type = "text" i.Type = "text"
if !modify { if !modify {