mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 22:34:55 +00:00
7ce2b48cb7
* Implement the ServerDiscovery.WatchServers gRPC endpoint * Fix the ConnectCA.Sign gRPC endpoints metadata forwarding. * Unify public gRPC endpoints around the public.TraceID function for request_id logging
17 lines
261 B
Go
17 lines
261 B
Go
package public
|
|
|
|
import (
|
|
"context"
|
|
|
|
"google.golang.org/grpc/metadata"
|
|
)
|
|
|
|
func ForwardMetadataContext(ctx context.Context) context.Context {
|
|
md, ok := metadata.FromIncomingContext(ctx)
|
|
if !ok {
|
|
return ctx
|
|
}
|
|
|
|
return metadata.NewOutgoingContext(ctx, md)
|
|
}
|