1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-29 09:55:35 +02:00

Merge branch 'main' into access-api

This commit is contained in:
binwiederhier 2023-05-14 20:43:07 -04:00
commit 4f4165f46f
5 changed files with 1873 additions and 19 deletions
server

View file

@ -652,6 +652,9 @@ func (s *Server) handleFile(w http.ResponseWriter, r *http.Request, v *visitor)
return err
}
defer f.Close()
if m.Attachment.Name != "" {
w.Header().Set("Content-Disposition", "attachment; filename="+strconv.Quote(m.Attachment.Name))
}
_, err = io.Copy(util.NewContentTypeWriter(w, r.URL.Path), f)
return err
}