diff --git a/cmd/whoami/main.go b/cmd/whoami/main.go index 86d3ff2..2e3eaba 100644 --- a/cmd/whoami/main.go +++ b/cmd/whoami/main.go @@ -39,11 +39,12 @@ func handler(w http.ResponseWriter, r *http.Request) { if parsedIP.To4() == nil { if (showIP) { w.Write([]byte(ip + "\n")) + log.Println(ip) } else { - w.Write([]byte(domainFromIP(parsedIP) + "\n")) + domain := domainFromIP(parsedIP) + w.Write([]byte(domain + "\n")) + log.Println(domain) } - log.Println(showIP) - log.Println(ip) } else { // set the response status code to 422 w.WriteHeader(http.StatusUnprocessableEntity)