mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-22 22:28:51 +01:00
If X-Real-IP header isn't set, use the client's real IP instead of unknwon (fixes #126)
This commit is contained in:
parent
d8b83b9429
commit
67c67b76cd
@ -69,7 +69,7 @@ func getHishtoryVersion(r *http.Request) string {
|
||||
func getRemoteAddr(r *http.Request) string {
|
||||
addr, ok := r.Header["X-Real-Ip"]
|
||||
if !ok || len(addr) == 0 {
|
||||
return "UnknownIp"
|
||||
return r.RemoteAddr
|
||||
}
|
||||
return addr[0]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user