feat: allow disabling file detections by reading header (#1175)

This commit is contained in:
WeidiDeng authored and GitHub committed 2021-01-07 11:30:17 +01:00
1 parent 43e0d4a856
commit 6914063853
8 files changed
+104 -85

No files matched your search

+6 -5
View File
@@ -46,11 +46,12 @@ func previewHandler(imgSvc ImgService, fileCache FileCache, enableThumbnails, re
}
file, err := files.NewFileInfo(files.FileOptions{
Fs: d.user.Fs,
Path: "/" + vars["path"],
Modify: d.user.Perm.Modify,
Expand: true,
Checker: d,
Fs: d.user.Fs,
Path: "/" + vars["path"],
Modify: d.user.Perm.Modify,
Expand: true,
ReadHeader: d.server.TypeDetectionByHeader,
Checker: d,
})
if err != nil {
return errToStatus(err), err