1 Commits

Author SHA1 Message Date
13f95ee895 Allow real IP from loopback AND private
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/tag Build is passing
2022-03-30 22:58:15 -04:00

View File

@ -29,7 +29,9 @@ func RealIPMiddleware(f http.Handler) http.Handler {
return return
} }
if !net.ParseIP(host).IsPrivate() { netIP := net.ParseIP(host)
if !netIP.IsLoopback() && !netIP.IsPrivate() {
f.ServeHTTP(w, r) f.ServeHTTP(w, r)
return return
} }