Fix media URL extension for m4a uploads

This commit is contained in:
richjohnrambo
2026-09-07 09:57:16 +08:00
parent 7a1647bf17
commit 6330c592cf
5 changed files with 59 additions and 17 deletions
+1 -5
View File
@@ -7,7 +7,6 @@ import (
"errors"
"hash/fnv"
"io"
"mime"
"net/http"
"net/url"
"path"
@@ -247,10 +246,7 @@ func (oh *ossHandler) Upload(fdef *types.FileDef, file io.Reader) (string, int64
}
fname := fdef.Id
ext, _ := mime.ExtensionsByType(fdef.MimeType)
if len(ext) > 0 {
fname += ext[0]
}
fname += media.ExtensionByMimeType(fdef.MimeType)
fdef.Location = key
fdef.ETag = etagFromLocation(key)