鉴权兼容 IPv6 本机回环地址 (#6400)
* 🐛 fix #5857 * 🎨 #5990 桌面端 `SiYuan` 可执行程序支持使用参数连接非本机内核服务 * 🎨 style * 🎨 style * 🎨 style * 🎨 改进伺服代码片段 `/snippets/` #6356 * 🎨 调整 win 安装包打包选项 * 🎨 鉴权支持 IPv6 本机回环地址
This commit is contained in:
parent
e6365543d0
commit
a6e9199d88
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue