Allow real IP from loopback AND private
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Tyler 2022-03-30 22:58:15 -04:00
parent 99c0137034
commit 13f95ee895
1 changed files with 3 additions and 1 deletions

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
}