oauth2-proxy/pkg/ip
h1net bdae010163 fix: handle Unix socket RemoteAddr in IP resolution
When oauth2-proxy listens on a Unix socket, Go sets RemoteAddr to "@"
instead of the usual "host:port" format. This caused net.SplitHostPort
to fail on every request, flooding logs with errors:

  Error obtaining real IP for trusted IP list: unable to get ip and
  port from http.RemoteAddr (@)

Fix by handling the "@" RemoteAddr at the source in getRemoteIP,
returning nil without error since Unix sockets have no meaningful
client IP. Also simplify the isTrustedIP guard and add a nil check
in GetClientString to prevent calling String() on nil net.IP.

Fixes #3373
2026-03-14 22:40:49 +00:00
..
net_set.go Implements --trusted-ip option (#552) 2020-07-11 11:10:58 +01:00
net_set_test.go Implements --trusted-ip option (#552) 2020-07-11 11:10:58 +01:00
parse_ip_net.go Implements --trusted-ip option (#552) 2020-07-11 11:10:58 +01:00
realclientip.go fix: handle Unix socket RemoteAddr in IP resolution 2026-03-14 22:40:49 +00:00
realclientip_test.go fix: handle Unix socket RemoteAddr in IP resolution 2026-03-14 22:40:49 +00:00