MCPcopy
hub / github.com/grafana/tempo / headersFromGrpcContext

Function headersFromGrpcContext

modules/frontend/grpc_util.go:15–31  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

13}
14
15func headersFromGrpcContext(ctx context.Context) (hs http.Header) {
16 hs = http.Header{}
17
18 md, ok := metadata.FromIncomingContext(ctx)
19 if !ok {
20 // Tests may not have metadata so skip
21 return
22 }
23
24 for _, h := range copyHeaders {
25 if v := md.Get(h); len(v) > 0 {
26 hs[h] = v
27 }
28 }
29
30 return
31}

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected