fix(stability): standardize request identity, readiness and predictable build

This commit is contained in:
OpenGenesis (MPL 2.0) committed 2026-10-21 13:20:05 +02:00
1 parent 3ab53a9808
commit cb5d9fccfe
1 file changed
+1 -12
+1 -12
View File
@@ -184,18 +184,7 @@ type chartVoteStatus struct {
}
func chartVoterKey(r *http.Request) string {
voter := strings.TrimSpace(r.Header.Get("X-Forwarded-For"))
if i := strings.Index(voter, ","); i >= 0 {
voter = voter[:i]
}
voter = strings.TrimSpace(voter)
if voter == "" {
voter = strings.TrimSpace(r.RemoteAddr)
if host, _, err := net.SplitHostPort(voter); err == nil {
voter = host
}
}
return voter + "|" + r.UserAgent()
return requestClientIP(r) + "|" + r.UserAgent()
}
func (s *chartStore) VoteStatuses(ctx context.Context, chartKey, voterKey string) ([]chartVoteStatus, error) {