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)

View file

@ -141,7 +141,7 @@ func GenerateEditToken(userID int, username, secret, filePath string) (string, e
claims := jwt.MapClaims{
"sub": userID,
"username": username,
"exp": time.Now().Add(24 * time.Hour).Unix(),
"exp": time.Now().Add(7 * 24 * time.Hour).Unix(),
"iat": time.Now().Unix(),
"type": "edit",
}