fix(email): 补全模板 helper 写入错误检查
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
0fd8c060df
commit
e1b53fdeba
@ -777,9 +777,9 @@ func safeNotificationEmailKeyPart(value string) string {
|
||||
var builder strings.Builder
|
||||
for _, r := range value {
|
||||
if (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r == '-' || r == '.' {
|
||||
builder.WriteRune(r)
|
||||
_, _ = builder.WriteRune(r)
|
||||
} else {
|
||||
builder.WriteRune('_')
|
||||
_, _ = builder.WriteRune('_')
|
||||
}
|
||||
}
|
||||
return builder.String()
|
||||
@ -787,7 +787,7 @@ func safeNotificationEmailKeyPart(value string) string {
|
||||
|
||||
func signNotificationEmailToken(secret, payload string) string {
|
||||
mac := hmac.New(sha256.New, []byte(secret))
|
||||
mac.Write([]byte(payload))
|
||||
_, _ = mac.Write([]byte(payload))
|
||||
return base64.RawURLEncoding.EncodeToString(mac.Sum(nil))
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user