grpc-ecosystem / go-grpc-middleware

Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.
Apache License 2.0
6.29k stars 693 forks source link

Extend realip parsing of GRPC peer address to handle IPv6 #692

Closed surik closed 9 months ago

surik commented 9 months ago

Changes

Use netip.ParseAddrPort instead of strings.Split to support extraction of both ipv4 and ipv6.

Verification

The interceptors/realip/realip_test.go file was extended with additional cases.

johanbrandhorst commented 9 months ago

Thanks for your contribution!