Address all security review comments: sanitize remaining error messages and handle errors properly

Co-authored-by: krau <71133316+krau@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-19 04:50:48 +00:00
parent 9dcb5201e1
commit 30c165033e
2 changed files with 16 additions and 7 deletions

View File

@@ -91,7 +91,12 @@ func getClientIP(r *http.Request) string {
}
// Fall back to RemoteAddr
ip, _, _ := net.SplitHostPort(r.RemoteAddr)
ip, _, err := net.SplitHostPort(r.RemoteAddr)
if err != nil {
// If SplitHostPort fails, RemoteAddr might not have a port
// In this case, just return RemoteAddr as is
return r.RemoteAddr
}
return ip
}