From d6598a56b9318dc5431b8bbf67d70a71af8d5c72 Mon Sep 17 00:00:00 2001 From: niubility000 <76441520+niubility000@users.noreply.github.com> Date: Sat, 18 Dec 2021 01:03:27 +0800 Subject: [PATCH] Add files via upload --- http/preview.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/http/preview.go b/http/preview.go index bc3a3862..dd815456 100644 --- a/http/preview.go +++ b/http/preview.go @@ -7,9 +7,8 @@ import ( "fmt" "io" "net/http" - "github.com/gorilla/mux" - + "path/filepath" "github.com/filebrowser/filebrowser/v2/files" "github.com/filebrowser/filebrowser/v2/img" ) @@ -153,6 +152,6 @@ func createPreview(imgSvc ImgService, d *data, fileCache FileCache, } func previewCacheKey(fPath string, fTime int64, previewSize PreviewSize, d *data) string { - fPath = d.user.Scope + fPath + fPath = filepath.Clean("/"+ d.user.Scope + fPath) return fmt.Sprintf("%x%x%x", fPath, fTime, previewSize) }