diff --git a/app/changelogs/v3.6.4/v3.6.4.md b/app/changelogs/v3.6.4/v3.6.4.md index db4cf6c93..2734875df 100644 --- a/app/changelogs/v3.6.4/v3.6.4.md +++ b/app/changelogs/v3.6.4/v3.6.4.md @@ -35,7 +35,7 @@ Below are the detailed changes in this version. ### Development * [Task lists support the `data-task` status attribute](https://github.com/siyuan-note/siyuan/issues/17343) -* [Add `type` parameter to `getAllTabs` plugin](https://github.com/siyuan-note/siyuan/issues/17354) +* [Add a `type` parameter to the plugin API `getAllTabs`](https://github.com/siyuan-note/siyuan/issues/17354) * [Add kernel API `/api/file/workspaceCopyFiles`](https://github.com/siyuan-note/siyuan/pull/17421) * [Add kernel API `/api/block/updateTaskListItemMarker`](https://github.com/siyuan-note/siyuan/issues/17451) * [Add kernel API `/api/block/batchUpdateTaskListItemMarker`](https://github.com/siyuan-note/siyuan/pull/17461) diff --git a/app/changelogs/v3.6.4/v3.6.4_zh_CHT.md b/app/changelogs/v3.6.4/v3.6.4_zh_CHT.md index 5386aac07..5c0211ebe 100644 --- a/app/changelogs/v3.6.4/v3.6.4_zh_CHT.md +++ b/app/changelogs/v3.6.4/v3.6.4_zh_CHT.md @@ -35,7 +35,7 @@ ### 開發者 * [任務清單支援 `data-task` 狀態屬性](https://github.com/siyuan-note/siyuan/issues/17343) -* [為 `getAllTabs` 外掛程式新增 `type` 參數](https://github.com/siyuan-note/siyuan/issues/17354) +* [為插件 API `getAllTabs` 新增 `type` 參數](https://github.com/siyuan-note/siyuan/issues/17354) * [新增核心 API `/api/file/workspaceCopyFiles`](https://github.com/siyuan-note/siyuan/pull/17421) * [新增內核 API `/api/block/updateTaskListItemMarker`](https://github.com/siyuan-note/siyuan/issues/17451) * [新增核心 API `/api/block/batchUpdateTaskListItemMarker`](https://github.com/siyuan-note/siyuan/pull/17461) diff --git a/app/changelogs/v3.6.4/v3.6.4_zh_CN.md b/app/changelogs/v3.6.4/v3.6.4_zh_CN.md index 6bce84208..584e5c3c7 100644 --- a/app/changelogs/v3.6.4/v3.6.4_zh_CN.md +++ b/app/changelogs/v3.6.4/v3.6.4_zh_CN.md @@ -35,7 +35,7 @@ ### 开发者 * [任务列表支持 `data-task` 状态属性](https://github.com/siyuan-note/siyuan/issues/17343) -* [为 `getAllTabs` 插件添加 `type` 参数](https://github.com/siyuan-note/siyuan/issues/17354) +* [为插件 API `getAllTabs` 添加 `type` 参数](https://github.com/siyuan-note/siyuan/issues/17354) * [新增内核 API `/api/file/workspaceCopyFiles`](https://github.com/siyuan-note/siyuan/pull/17421) * [新增内核 API `/api/block/updateTaskListItemMarker`](https://github.com/siyuan-note/siyuan/issues/17451) * [新增内核 API `/api/block/batchUpdateTaskListItemMarker`](https://github.com/siyuan-note/siyuan/pull/17461) diff --git a/kernel/util/websocket.go b/kernel/util/websocket.go index 321a83e15..51b49dcde 100644 --- a/kernel/util/websocket.go +++ b/kernel/util/websocket.go @@ -17,12 +17,14 @@ package util import ( + "strings" "sync" "time" "github.com/88250/gulu" "github.com/olahol/melody" "github.com/siyuan-note/eventbus" + "github.com/siyuan-note/logging" ) var ( @@ -107,11 +109,25 @@ func SessionsByType(typ string) (ret []*melody.Session) { } func AddPushChan(session *melody.Session) { - appID := session.Request.URL.Query().Get("app") + appID := strings.TrimSpace(session.Request.URL.Query().Get("app")) + if "" == appID { + logging.LogErrorf("app id is required") + return + } session.Set("app", appID) - id := session.Request.URL.Query().Get("id") + + id := strings.TrimSpace(session.Request.URL.Query().Get("id")) + if "" == id { + logging.LogErrorf("id is required") + return + } session.Set("id", id) - typ := session.Request.URL.Query().Get("type") + + typ := strings.TrimSpace(session.Request.URL.Query().Get("type")) + if "" == typ { + logging.LogErrorf("type is required") + return + } session.Set("type", typ) if IsAuthSession(session) {