diff --git a/proxy/session.go b/proxy/session.go index d063a9a..56327f2 100644 --- a/proxy/session.go +++ b/proxy/session.go @@ -25,10 +25,10 @@ func (proxy *BeaconProxy) getSessionForRequest(r *http.Request) *ProxySession { var ip string if proxy.config.ProxyCount > 0 { - forwardIps := strings.Split(r.Header.Get("X-Forwarded-For"), ", ") + forwardIps := strings.Split(r.Header.Get("X-Forwarded-For"), ",") forwardIdx := len(forwardIps) - int(proxy.config.ProxyCount) if forwardIdx >= 0 { - ip = forwardIps[forwardIdx] + ip = strings.Trim(forwardIps[forwardIdx], " ") } } if ip == "" {