Use realIP
All checks were successful
Build and Push Docker Image on Tag / Build and Push Docker Image (push) Successful in 15m31s

Code was copied from https://github.com/go-chi/chi/blob/master/middleware/realip.go
This commit is contained in:
2025-02-01 17:07:24 +01:00
parent 5a0da6560d
commit f519b94392
3 changed files with 24 additions and 2 deletions

View File

@ -277,7 +277,7 @@ func (app *application) createVotesHandleKnownVotersElection(w http.ResponseWrit
}
func (app *application) createVotesHandleUnknownVotersElection(w http.ResponseWriter, r *http.Request, election *models.Election) (string, error) {
voterIdentity := r.RemoteAddr
voterIdentity := realIP(r)
voterExists, err := app.voters.Exists(voterIdentity, election.ID)
if err != nil {