fix(stability): standardize request identity, readiness and predictable build
This commit is contained in:
1 parent
1b7c018e48
commit
e5122f23ff
1 file changed
+1
-10
+1
-10
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user