handles json files like text files to make them editable again
This commit is contained in:
parent
e1f658633d
commit
233d33428d
@ -167,7 +167,7 @@ func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error {
|
||||
case strings.HasPrefix(mimetype, "image"):
|
||||
i.Type = "image"
|
||||
return nil
|
||||
case (strings.HasPrefix(mimetype, "text") || (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"
|
||||
|
||||
if !modify {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user