diff options
author | terminaldweller <devi@terminaldweller.com> | 2025-05-01 22:16:45 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2025-05-01 22:16:45 +0000 |
commit | 39a742d2ff7512d4deb9967641558b848325d620 (patch) | |
tree | 7188f5c8f650daa3a306e46a5ef04a3eea9a8cdd /main.go | |
parent | update (diff) | |
download | icanhazallips-main.tar.gz icanhazallips-main.zip |
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -43,8 +43,8 @@ func getIP(request *http.Request) (string, error) { log.Println(request.RemoteAddr) - if len(splitIps) > 1 { - netIP := net.ParseIP(splitIps[len(splitIps)-2]) + if len(splitIps) > 0 { + netIP := net.ParseIP(splitIps[len(splitIps)-1]) log.Println("one:", netIP.String()) if netIP != nil { return netIP.String(), nil |