diff options
author | MichaelKo <[email protected]> | 2020-05-07 14:41:44 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-07 14:41:44 +0200 |
commit | 4f1630991bccf3b38701e2c7970543bb9c8e1f00 (patch) | |
tree | f52fc5241080524569f736ff1f48c50d35fb6082 | |
parent | 4d7dff992d7aef6775744f91ce2766d164f4a5da (diff) |
Add support of CloudFlare True-Client-IP header
-rw-r--r-- | service/http/handler.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/service/http/handler.go b/service/http/handler.go index 3c667035..802de2c2 100644 --- a/service/http/handler.go +++ b/service/http/handler.go @@ -178,4 +178,8 @@ func (h *Handler) resolveIP(r *Request) { if r.Header.Get("X-Real-Ip") != "" { r.RemoteAddr = fetchIP(r.Header.Get("X-Real-Ip")) } + + if r.Header.Get("True-Client-IP") != "" { + r.RemoteAddr = fetchIP(r.Header.Get("True-Client-IP")) + } } |