mirror of
https://github.com/linka-cloud/grpc.git
synced 2024-11-21 18:36:25 +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 (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
@ -46,6 +47,9 @@ func DefaultActorFunc(ctx context.Context) (string, bool, error) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
return "", false, nil
|
return "", false, nil
|
||||||
}
|
}
|
||||||
|
if host, _, err := net.SplitHostPort(p.Addr.String()); err == nil {
|
||||||
|
return host, true, nil
|
||||||
|
}
|
||||||
return p.Addr.String(), true, nil
|
return p.Addr.String(), true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user