diff --git a/src/api/api.go b/src/api/api.go index 1f9bc24..3a0f774 100644 --- a/src/api/api.go +++ b/src/api/api.go @@ -204,13 +204,9 @@ func send(c *gin.Context, attachmentTmpDir string, signalCliConfig string, numbe return } - fType, err := filetype.Get(dec) - if err != nil { - c.JSON(400, gin.H{"error": err.Error()}) - return - } + mimeType := mimetype.Detect(dec) - attachmentTmpPath := attachmentTmpDir + u.String() + "." + fType.Extension + attachmentTmpPath := attachmentTmpDir + u.String() + "." + mimeType.Extension() attachmentTmpPaths = append(attachmentTmpPaths, attachmentTmpPath) f, err := os.Create(attachmentTmpPath)