We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f67bff7 commit 7ef888aCopy full SHA for 7ef888a
internal/middleware/ip_whitelist.go
@@ -1,16 +1,17 @@
1
package middleware
2
3
import (
4
+ "net/http"
5
+
6
"github.com/0xJacky/Nginx-UI/settings"
7
"github.com/gin-gonic/gin"
8
"github.com/samber/lo"
- "net/http"
9
)
10
11
func IPWhiteList() gin.HandlerFunc {
12
return func(c *gin.Context) {
13
clientIP := c.ClientIP()
- if len(settings.AuthSettings.IPWhiteList) == 0 || clientIP == "127.0.0.1" {
14
+ if len(settings.AuthSettings.IPWhiteList) == 0 || clientIP == "127.0.0.1" || clientIP == "::1" {
15
c.Next()
16
return
17
}
0 commit comments