diff options
author | Wolfy-J <[email protected]> | 2019-09-06 13:05:16 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-09-06 13:05:16 +0300 |
commit | 461db7f19195f70306e41e8920616c53eb00c1f3 (patch) | |
tree | 4f54e937e1a3cba255ff3a712cc7b55d6515aed7 /service/http/handler.go | |
parent | 2ac01468ee745ace3a72742aa97cbd3e51d6dae2 (diff) |
- bugfix: proper proxy IP validation + CS
Diffstat (limited to 'service/http/handler.go')
-rw-r--r-- | service/http/handler.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/service/http/handler.go b/service/http/handler.go index 19179b72..a4da224d 100644 --- a/service/http/handler.go +++ b/service/http/handler.go @@ -3,6 +3,7 @@ package http import ( "github.com/pkg/errors" "github.com/spiral/roadrunner" + "net" "net/http" "strconv" "strings" @@ -157,7 +158,7 @@ func (h *Handler) resolveIP(r *Request) { for i := ipCount - 1; i >= 0; i-- { addr := strings.TrimSpace(ips[i]) - if h.cfg.IsValid(addr) { + if net.ParseIP(addr) != nil { r.RemoteAddr = addr return } |