mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
handle IPv6 sourceIPs properly (#15005)
This commit is contained in:
@@ -123,5 +123,8 @@ func GetSourceIP(r *http.Request) string {
|
||||
|
||||
// Default to remote address if headers not set.
|
||||
addr, _, _ = net.SplitHostPort(r.RemoteAddr)
|
||||
if strings.ContainsRune(addr, ':') {
|
||||
return "[" + addr + "]"
|
||||
}
|
||||
return addr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user