diff options
Diffstat (limited to 'lib/attachment.go')
-rw-r--r-- | lib/attachment.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/attachment.go b/lib/attachment.go index 5c2284f5..f6118780 100644 --- a/lib/attachment.go +++ b/lib/attachment.go @@ -71,10 +71,8 @@ func (fa *FileAttachment) WriteTo(w *mail.Writer) error { // under the hood, e.g. most office file types ext := filepath.Ext(fa.path) var mimeString string - if mimeString = mime.TypeByExtension(ext); mimeString != "" { - // found it in the DB - } else { - // Sniff the mime type instead + if mimeString = mime.TypeByExtension(ext); mimeString == "" { + // Sniff the mime type since it's not in the database // http.DetectContentType only cares about the first 512 bytes head, err := reader.Peek(512) if err != nil && err != io.EOF { |