Skip to content

Commit

Permalink
Fix getRealIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ac0d3r committed Dec 15, 2021
1 parent 31c4541 commit 172585d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hyuga/handler/oob/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ func HttpLog(c *gin.Context) {
}

func getRealIP(r *http.Request) string {
ip := r.Header.Get("X-Real-Ip")
ip := r.Header.Get("X-Real-IP")
if ip == "" {
ip = r.Header.Get("X-Forwarded-For")
}
if ip == "" {
ip = r.RemoteAddr
}
return ip
return strings.Split(ip, ":")[0]
}

func getIdentity(domain, sub string) string {
Expand Down

0 comments on commit 172585d

Please sign in to comment.