From a6e9199d88ddb111a2329a91b23995e543fcbaf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A2=96=E9=80=B8?= <49649786+Zuoqiu-Yingyi@users.noreply.github.com> Date: Sat, 29 Oct 2022 23:31:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=89=B4=E6=9D=83=E5=85=BC=E5=AE=B9=20IPv6=20?= =?UTF-8?q?=E6=9C=AC=E6=9C=BA=E5=9B=9E=E7=8E=AF=E5=9C=B0=E5=9D=80=20(#6400?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :bug: fix #5857 * :art: #5990 桌面端 `SiYuan` 可执行程序支持使用参数连接非本机内核服务 * :art: style * :art: style * :art: style * 🎨 改进伺服代码片段 `/snippets/` #6356 * :art: 调整 win 安装包打包选项 * :art: 鉴权支持 IPv6 本机回环地址 --- kernel/model/session.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/model/session.go b/kernel/model/session.go index b82dd6c44..b4607454c 100644 --- a/kernel/model/session.go +++ b/kernel/model/session.go @@ -171,8 +171,10 @@ func CheckAuth(c *gin.Context) { } // 放过来自本机的某些请求 - if strings.HasPrefix(c.Request.RemoteAddr, util.LocalHost) || strings.HasPrefix(c.Request.RemoteAddr, "127.0.0.1") { - if strings.HasPrefix(c.Request.RequestURI, "/assets/") || strings.HasPrefix(c.Request.RequestURI, "/history/assets/") { + if strings.HasPrefix(c.Request.RemoteAddr, util.LocalHost) || + strings.HasPrefix(c.Request.RemoteAddr, "127.0.0.1") || + strings.HasPrefix(c.Request.RemoteAddr, "[::1]") { + if strings.HasPrefix(c.Request.RequestURI, "/assets/") { c.Next() return }