diff --git a/http/preview.go b/http/preview.go index 163d7e49..0e3e5ec6 100644 --- a/http/preview.go +++ b/http/preview.go @@ -46,12 +46,14 @@ 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, - ReadHeader: d.server.TypeDetectionByHeader, - Checker: d, + Fs: d.user.Fs, + Path: "/" + vars["path"], + Modify: d.user.Perm.Modify, + Expand: true, + ReadHeader: d.server.TypeDetectionByHeader, + Checker: d, + RootPath: d.server.Root, + AnotherPath: d.server.AnotherPath, }) if err != nil { return errToStatus(err), err diff --git a/http/raw.go b/http/raw.go index 9bf982e9..662e11ce 100644 --- a/http/raw.go +++ b/http/raw.go @@ -82,12 +82,14 @@ var rawHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data) } file, err := files.NewFileInfo(files.FileOptions{ - Fs: d.user.Fs, - Path: r.URL.Path, - Modify: d.user.Perm.Modify, - Expand: false, - ReadHeader: d.server.TypeDetectionByHeader, - Checker: d, + Fs: d.user.Fs, + Path: r.URL.Path, + Modify: d.user.Perm.Modify, + Expand: false, + ReadHeader: d.server.TypeDetectionByHeader, + Checker: d, + RootPath: d.server.Root, + AnotherPath: d.server.AnotherPath, }) if err != nil { return errToStatus(err), err diff --git a/http/tus_handlers.go b/http/tus_handlers.go index 15003cce..a112704d 100644 --- a/http/tus_handlers.go +++ b/http/tus_handlers.go @@ -17,12 +17,14 @@ import ( func tusPostHandler() handleFunc { return withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { file, err := files.NewFileInfo(files.FileOptions{ - Fs: d.user.Fs, - Path: r.URL.Path, - Modify: d.user.Perm.Modify, - Expand: false, - ReadHeader: d.server.TypeDetectionByHeader, - Checker: d, + Fs: d.user.Fs, + Path: r.URL.Path, + Modify: d.user.Perm.Modify, + Expand: false, + ReadHeader: d.server.TypeDetectionByHeader, + Checker: d, + RootPath: d.server.Root, + AnotherPath: d.server.AnotherPath, }) switch { case errors.Is(err, afero.ErrFileNotFound): @@ -72,12 +74,14 @@ func tusHeadHandler() handleFunc { } file, err := files.NewFileInfo(files.FileOptions{ - Fs: d.user.Fs, - Path: r.URL.Path, - Modify: d.user.Perm.Modify, - Expand: false, - ReadHeader: d.server.TypeDetectionByHeader, - Checker: d, + Fs: d.user.Fs, + Path: r.URL.Path, + Modify: d.user.Perm.Modify, + Expand: false, + ReadHeader: d.server.TypeDetectionByHeader, + Checker: d, + RootPath: d.server.Root, + AnotherPath: d.server.AnotherPath, }) if err != nil { return errToStatus(err), err @@ -105,12 +109,14 @@ func tusPatchHandler() handleFunc { } file, err := files.NewFileInfo(files.FileOptions{ - Fs: d.user.Fs, - Path: r.URL.Path, - Modify: d.user.Perm.Modify, - Expand: false, - ReadHeader: d.server.TypeDetectionByHeader, - Checker: d, + Fs: d.user.Fs, + Path: r.URL.Path, + Modify: d.user.Perm.Modify, + Expand: false, + ReadHeader: d.server.TypeDetectionByHeader, + Checker: d, + RootPath: d.server.Root, + AnotherPath: d.server.AnotherPath, }) switch {