Skip to content

Commit

Permalink
Merge pull request #32 from delta10/fix/do-not-use-x-real-ip
Browse files Browse the repository at this point in the history
fix: do not use X-Real-IP
  • Loading branch information
bartjkdp authored Feb 20, 2024
2 parents 7cfb5de + 3f383ad commit 436d046
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ func EnvSubst(input string) string {
}

func ReadUserIP(r *http.Request) string {
IPAddress := r.Header.Get("X-Real-Ip")
if IPAddress == "" {
IPAddress = r.Header.Get("X-Forwarded-For")
}
IPAddress := r.Header.Get("X-Forwarded-For")
if IPAddress == "" {
host, _, _ := net.SplitHostPort(r.RemoteAddr)
IPAddress = host
Expand Down

0 comments on commit 436d046

Please sign in to comment.