Multipart encryption stuff

This commit is contained in:
Philipp Heckel 2022-07-15 16:52:37 -04:00
parent ec3ba6331c
commit 9514e97219
5 changed files with 135 additions and 10 deletions

View file

@ -177,6 +177,8 @@ func ShortTopicURL(s string) string {
func DetectContentType(b []byte, filename string) (mimeType string, ext string) {
if strings.HasSuffix(strings.ToLower(filename), ".apk") {
return "application/vnd.android.package-archive", ".apk"
} else if strings.HasSuffix(strings.ToLower(filename), ".jwe") {
return "application/jose", ".jwe"
}
m := mimetype.Detect(b)
mimeType, ext = m.String(), m.Extension()