Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/10153

Daniele771fe7d7b4e
diff --git a/kernel/api/notification.go b/kernel/api/notification.go
index 00f9c0b74e..704107680e 100644
--- a/kernel/api/notification.go
+++ b/kernel/api/notification.go
@@ -18,6 +18,7 @@ package api
import (
"net/http"
+ "strings"
"github.com/88250/gulu"
"github.com/gin-gonic/gin"
@@ -33,7 +34,13 @@ func pushMsg(c *gin.Context) {
return
}
- msg := arg["msg"].(string)
+ msg := strings.TrimSpace(arg["msg"].(string))
+ if "" == msg {
+ ret.Code = -1
+ ret.Msg = "msg can't be empty"
+ return
+ }
+
timeout := 7000
if nil != arg["timeout"] {
timeout = int(arg["timeout"].(float64))