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

This commit is contained in:
Tyler 2022-03-30 22:58:15 -04:00
parent 99c0137034
commit 13f95ee895

View File

@ -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
}