Skip to content

Commit

Permalink
feat: 仅在token不为空时进行设置 (#1339)
Browse files Browse the repository at this point in the history
  • Loading branch information
WTIFS authored Mar 18, 2024
1 parent 4c73280 commit 6c4e593
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apiserver/grpcserver/discover/v1/client_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ func (g *DiscoverServer) Discover(server apiservice.PolarisGRPC_DiscoverServer)
})
}()

if in.GetService().GetToken().GetValue() != "" {
ctx = context.WithValue(ctx, utils.ContextAuthTokenKey, in.GetService().GetToken().GetValue())
}

switch in.Type {
case apiservice.DiscoverRequest_INSTANCE:
action = metrics.ActionDiscoverInstance
Expand Down

0 comments on commit 6c4e593

Please sign in to comment.