Skip to content

Commit 60c989f

Browse files
committed
fix(be): alert email content encoding
1 parent 07a1698 commit 60c989f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pkg/task_logger/task_logger.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package task_logger
22

33
import (
44
"os/exec"
5-
"strings"
65
"time"
76
)
87

@@ -53,8 +52,12 @@ func (s TaskStatus) Format() (res string) {
5352
res += "⏹️"
5453
case TaskWaitingConfirmation:
5554
res += "⚠️"
55+
default:
56+
res += "❓"
5657
}
57-
res += strings.ToUpper(string(s))
58+
59+
// to avoid email content injection issue
60+
//res += strings.ToUpper(string(s))
5861

5962
return
6063
}

util/mailer/mailer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package mailer
22

33
import (
44
"bytes"
5-
"html/template"
65
"net"
76
"net/smtp"
87
"strings"
8+
"text/template"
99
"time"
1010
)
1111

0 commit comments

Comments
 (0)