提交 c63987d7 编写于 作者: U Ulric Qin

add limit for local call

上级 086dcad8
......@@ -233,7 +233,7 @@ func loginUsername(c *gin.Context) string {
ip = remoteAddr[0:idx]
}
if ip == "127.0.0.1" {
if (ip == "127.0.0.1" || ip == "[::1]") && c.GetHeader("X-Local") == "1" {
//本地调用都当成是root用户在调用
username = "root"
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册