Allow real IP from loopback AND private
This commit is contained in:
parent
99c0137034
commit
13f95ee895
|
@ -29,7 +29,9 @@ func RealIPMiddleware(f http.Handler) http.Handler {
|
|||
return
|
||||
}
|
||||
|
||||
if !net.ParseIP(host).IsPrivate() {
|
||||
netIP := net.ParseIP(host)
|
||||
|
||||
if !netIP.IsLoopback() && !netIP.IsPrivate() {
|
||||
f.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue