mirror of
https://github.com/linka-cloud/grpc.git
synced 2024-11-21 10:26:26 +00:00
ban: remove port from DefaultActorFunc
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
parent
23f1b78389
commit
1d3d5315a4
@ -2,6 +2,7 @@ package ban
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc/codes"
|
||||
@ -46,6 +47,9 @@ func DefaultActorFunc(ctx context.Context) (string, bool, error) {
|
||||
if !ok {
|
||||
return "", false, nil
|
||||
}
|
||||
if host, _, err := net.SplitHostPort(p.Addr.String()); err == nil {
|
||||
return host, true, nil
|
||||
}
|
||||
return p.Addr.String(), true, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user