fix(uploader): failed to generate upload token for some file types (#2847) (#2900)

* fix(mime): `mimeType` not assigned to new value when is empty

* fix(mime): add fallback mime type
This commit is contained in:
Darren Yu
2025-09-16 10:35:30 +08:00
committed by GitHub
parent 3b8110b648
commit 58ceae9708
7 changed files with 19 additions and 13 deletions

View File

@@ -36,5 +36,11 @@ func (d *mimeDetector) TypeByName(p string) string {
return m
}
return mime.TypeByExtension(ext)
m := mime.TypeByExtension(ext)
if m != "" {
return m
}
// Fallback
return "application/octet-stream"
}