Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit b8ed6b7

Browse files
committed
一些产品名使用常量定义
1 parent 5b20119 commit b8ed6b7

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

teaconfigs/notices/media_email.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package notices
33
import (
44
"crypto/tls"
55
"errors"
6+
"github.com/TeaWeb/code/teaconst"
67
"net"
78
"net/mail"
89
"net/smtp"
@@ -38,7 +39,7 @@ func (this *NoticeEmailMedia) Send(user string, subject string, body string) (re
3839
}
3940

4041
contentType := "Content-Type: text/html; charset=UTF-8"
41-
msg := []byte("To: " + user + "\r\nFrom: \"TeaWeb\" <" + this.From + ">\r\nSubject: " + subject + "\r\n" + contentType + "\r\n\r\n" + body)
42+
msg := []byte("To: " + user + "\r\nFrom: \"" + teaconst.TeaProductName + "\" <" + this.From + ">\r\nSubject: " + subject + "\r\n" + contentType + "\r\n\r\n" + body)
4243

4344
return nil, this.SendMail(this.From, []string{user}, msg)
4445
}

teawaf/action_block.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package teawaf
22

33
import (
4+
"github.com/TeaWeb/code/teaconst"
45
"github.com/TeaWeb/code/teautils"
56
"github.com/TeaWeb/code/teawaf/requests"
67
"github.com/iwind/TeaGo/Tea"
@@ -73,7 +74,7 @@ func (this *BlockAction) Perform(waf *WAF, request *requests.Request, writer htt
7374
if len(this.Body) > 0 {
7475
_, _ = writer.Write([]byte(this.Body))
7576
} else {
76-
_, _ = writer.Write([]byte("The request is blocked by TeaWAF"))
77+
_, _ = writer.Write([]byte("The request is blocked by " + teaconst.TeaProductName))
7778
}
7879
}
7980
return false

0 commit comments

Comments
 (0)