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:
parent
cb3300212f
commit
3528bc8da7
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user