Fix bugs: office auth, PDF worker, sidebar pins, direct downloads
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m0s

This commit is contained in:
Elijah 2026-05-31 21:16:17 -07:00
parent e88243f097
commit bfe55e2bfc
6 changed files with 74 additions and 32 deletions

View file

@ -1026,7 +1026,12 @@ func (h *FSHandler) Download(c *fiber.Ctx) error {
// Set appropriate headers for range requests
c.Set("Accept-Ranges", "bytes")
c.Set("Content-Type", mime.TypeByExtension(filepath.Ext(resolvedPath)))
c.Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", info.Name()))
if c.Query("download") == "true" {
c.Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", info.Name()))
} else {
c.Set("Content-Disposition", fmt.Sprintf("inline; filename=\"%s\"", info.Name()))
}
// Use Fiber's built-in SendFile which supports Range requests
return c.SendFile(resolvedPath)