Skip to content

Commit 9dec3e2

Browse files
committed
ipget
1 parent 4247ee4 commit 9dec3e2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/jwtmanager/jwtcache.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ func JWTCacheHandler(next http.Handler) http.Handler {
6060
if realIP == "" {
6161
realIP, _, _ = net.SplitHostPort(r.RemoteAddr)
6262
}
63+
if strings.Contains(realIP, ",") {
64+
parts := strings.Split(realIP, ",")
65+
realIP = strings.TrimSpace(parts[0])
66+
}
6367
log.Debugf("request ip: %s", realIP)
6468
for _, wip := range ipWhitelist {
6569
if realIP == wip {

0 commit comments

Comments
 (0)