mirror of
https://github.com/axllent/mailpit.git
synced 2025-08-13 20:04:49 +02:00
Fix: Add missing "latest" route to message attachment API endpoint (#437)
This commit is contained in:
@@ -174,6 +174,16 @@ func DownloadAttachment(w http.ResponseWriter, r *http.Request) {
|
|||||||
id := vars["id"]
|
id := vars["id"]
|
||||||
partID := vars["partID"]
|
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)
|
a, err := storage.GetAttachmentPart(id, partID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fourOFour(w)
|
fourOFour(w)
|
||||||
|
Reference in New Issue
Block a user