From 4f1630991bccf3b38701e2c7970543bb9c8e1f00 Mon Sep 17 00:00:00 2001 From: MichaelKo Date: Thu, 7 May 2020 14:41:44 +0200 Subject: Add support of CloudFlare True-Client-IP header --- service/http/handler.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'service/http') 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")) + } } -- cgit v1.2.3