1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-04-15 11:56:44 +02:00

Fix: Add missing "latest" route to message attachment API endpoint (#437)

This commit is contained in:
Ralph Slooten 2025-02-08 08:35:37 +13:00
parent cb3300212f
commit 3528bc8da7

View File

@ -174,6 +174,16 @@ func DownloadAttachment(w http.ResponseWriter, r *http.Request) {
id := vars["id"]
partID := vars["partID"]
if id == "latest" {
var err error
id, err = storage.LatestID(r)
if err != nil {
w.WriteHeader(404)
fmt.Fprint(w, err.Error())
return
}
}
a, err := storage.GetAttachmentPart(id, partID)
if err != nil {
fourOFour(w)