From 233d33428db9f2ca6f2927875850597e43e8ee93 Mon Sep 17 00:00:00 2001 From: Marcel Heers Date: Mon, 15 Mar 2021 15:14:02 +0100 Subject: [PATCH] handles json files like text files to make them editable again --- files/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/file.go b/files/file.go index 9e1eb19d..abd3766c 100644 --- a/files/file.go +++ b/files/file.go @@ -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 {