summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorMichaelKo <[email protected]>2020-05-07 14:41:44 +0200
committerGitHub <[email protected]>2020-05-07 14:41:44 +0200
commit4f1630991bccf3b38701e2c7970543bb9c8e1f00 (patch)
treef52fc5241080524569f736ff1f48c50d35fb6082 /service
parent4d7dff992d7aef6775744f91ce2766d164f4a5da (diff)
Add support of CloudFlare True-Client-IP header
Diffstat (limited to 'service')
-rw-r--r--service/http/handler.go4
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"))
+ }
}