mirror of
https://github.com/linka-cloud/grpc.git
synced 2024-12-22 08:50:46 +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