From e5122f23ff6cdaebadef3f3f8765f596ec892bc2 Mon Sep 17 00:00:00 2001 From: "OpenGenesis (MPL 2.0)" <153564363+opengenesislink@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:20:11 +0200 Subject: [PATCH] fix(stability): standardize request identity, readiness and predictable build --- site_analytics.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/site_analytics.go b/site_analytics.go index 7312952..eff5ad4 100644 --- a/site_analytics.go +++ b/site_analytics.go @@ -172,16 +172,7 @@ func analyticsSameOriginRequest(r *http.Request) bool { } func analyticsRemoteAddress(r *http.Request) string { - if r == nil { - return "unknown" - } - if forwarded := strings.TrimSpace(strings.Split(r.Header.Get("X-Forwarded-For"), ",")[0]); forwarded != "" { - return forwarded - } - if host, _, err := net.SplitHostPort(strings.TrimSpace(r.RemoteAddr)); err == nil { - return host - } - return strings.TrimSpace(r.RemoteAddr) + return requestClientIP(r) } func (s *siteAnalyticsStore) allowRequest(r *http.Request) bool {