diff options
Diffstat (limited to 'service/http/handler.go')
-rw-r--r-- | service/http/handler.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/service/http/handler.go b/service/http/handler.go index eeee5e35..457e7cb5 100644 --- a/service/http/handler.go +++ b/service/http/handler.go @@ -179,11 +179,12 @@ func (h *Handler) resolveIP(r *Request) { r.RemoteAddr = fetchIP(r.Header.Get("X-Real-Ip")) } - if r.Header.Get("CF-Connecting-IP") != "" { - r.RemoteAddr = fetchIP(r.Header.Get("CF-Connecting-IP")) - } - if r.Header.Get("True-Client-IP") != "" { r.RemoteAddr = fetchIP(r.Header.Get("True-Client-IP")) + return + } + + if r.Header.Get("CF-Connecting-IP") != "" { + r.RemoteAddr = fetchIP(r.Header.Get("CF-Connecting-IP")) } } |