(ctx context.Context)
| 178 | } |
| 179 | |
| 180 | func getRPCBehaviorMetadata(ctx context.Context) []string { |
| 181 | mdRPCBehavior := getMetadataValues(ctx, rpcBehaviorMDKey) |
| 182 | var rpcBehaviorMetadata []string |
| 183 | for _, mdVal := range mdRPCBehavior { |
| 184 | splitVals := strings.Split(mdVal, ",") |
| 185 | |
| 186 | for _, val := range splitVals { |
| 187 | headerVal := strings.TrimSpace(val) |
| 188 | if headerVal == "" { |
| 189 | continue |
| 190 | } |
| 191 | rpcBehaviorMetadata = append(rpcBehaviorMetadata, headerVal) |
| 192 | } |
| 193 | } |
| 194 | return rpcBehaviorMetadata |
| 195 | } |
| 196 | |
| 197 | func getMetadataValues(ctx context.Context, metadataKey string) []string { |
| 198 | md, ok := metadata.FromIncomingContext(ctx) |
no test coverage detected