Merge pull request #4 from berlineric/fix-downloader

fix download button doesn't work
This commit is contained in:
Erik Berlin 2024-02-12 10:23:21 +02:00 committed by GitHub
commit 8a621e05c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 40 additions and 30 deletions

View File

@ -52,6 +52,8 @@ func previewHandler(imgSvc ImgService, fileCache FileCache, enableThumbnails, re
Expand: true, Expand: true,
ReadHeader: d.server.TypeDetectionByHeader, ReadHeader: d.server.TypeDetectionByHeader,
Checker: d, Checker: d,
RootPath: d.server.Root,
AnotherPath: d.server.AnotherPath,
}) })
if err != nil { if err != nil {
return errToStatus(err), err return errToStatus(err), err

View File

@ -88,6 +88,8 @@ var rawHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data)
Expand: false, Expand: false,
ReadHeader: d.server.TypeDetectionByHeader, ReadHeader: d.server.TypeDetectionByHeader,
Checker: d, Checker: d,
RootPath: d.server.Root,
AnotherPath: d.server.AnotherPath,
}) })
if err != nil { if err != nil {
return errToStatus(err), err return errToStatus(err), err

View File

@ -23,6 +23,8 @@ func tusPostHandler() handleFunc {
Expand: false, Expand: false,
ReadHeader: d.server.TypeDetectionByHeader, ReadHeader: d.server.TypeDetectionByHeader,
Checker: d, Checker: d,
RootPath: d.server.Root,
AnotherPath: d.server.AnotherPath,
}) })
switch { switch {
case errors.Is(err, afero.ErrFileNotFound): case errors.Is(err, afero.ErrFileNotFound):
@ -78,6 +80,8 @@ func tusHeadHandler() handleFunc {
Expand: false, Expand: false,
ReadHeader: d.server.TypeDetectionByHeader, ReadHeader: d.server.TypeDetectionByHeader,
Checker: d, Checker: d,
RootPath: d.server.Root,
AnotherPath: d.server.AnotherPath,
}) })
if err != nil { if err != nil {
return errToStatus(err), err return errToStatus(err), err
@ -111,6 +115,8 @@ func tusPatchHandler() handleFunc {
Expand: false, Expand: false,
ReadHeader: d.server.TypeDetectionByHeader, ReadHeader: d.server.TypeDetectionByHeader,
Checker: d, Checker: d,
RootPath: d.server.Root,
AnotherPath: d.server.AnotherPath,
}) })
switch { switch {