(ctx context.Context, headers []string)
| 172 | } |
| 173 | |
| 174 | func applyHeadersGRPC(ctx context.Context, headers []string) context.Context { |
| 175 | parsed := parseHeaders(headers) |
| 176 | if len(parsed) == 0 { |
| 177 | return ctx |
| 178 | } |
| 179 | md, _ := metadata.FromOutgoingContext(ctx) |
| 180 | md = md.Copy() |
| 181 | for _, kv := range parsed { |
| 182 | md.Set(kv[0], kv[1]) |
| 183 | } |
| 184 | return metadata.NewOutgoingContext(ctx, md) |
| 185 | } |
| 186 | |
| 187 | func httpScheme(secure bool) string { |
| 188 | if secure { |