Skip to content

Commit

Permalink
feat: 保留兼容逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
WTIFS committed Mar 28, 2024
1 parent 798c0df commit 48db22e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 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,11 @@ func (g *DiscoverServer) Discover(server apiservice.PolarisGRPC_DiscoverServer)
})
}()

// 兼容。如果请求中带了token,优先使用该token
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 48db22e

Please sign in to comment.