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