Skip to content

Commit 674a32f

Browse files
committed
rework buf for minio, TODO squash
1 parent 6814a96 commit 674a32f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/mailer/mail.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"encoding/base64"
1111
"fmt"
1212
"html/template"
13+
"io"
1314
"mime"
1415
"net/http"
1516
"regexp"
@@ -439,8 +440,8 @@ func AttachmentSrcToBase64DataURI(attachmentPath string, ctx *MailCommentContext
439440
}
440441
defer fr.Close()
441442

442-
content := make([]byte, attachment.Size)
443-
if _, err := fr.Read(content); err != nil {
443+
content, err := io.ReadAll(fr)
444+
if err != nil {
444445
return "", err
445446
}
446447

0 commit comments

Comments
 (0)