Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename grpc.Params.headers to metadata? #2244

Closed
na-- opened this issue Nov 17, 2021 · 0 comments · Fixed by #2370
Closed

Rename grpc.Params.headers to metadata? #2244

na-- opened this issue Nov 17, 2021 · 0 comments · Fixed by #2370
Labels
breaking change for PRs that need to be mentioned in the breaking changes section of the release notes enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 ux
Milestone

Comments

@na--
Copy link
Member

na-- commented Nov 17, 2021

Prompted by https://community.k6.io/t/grpc-connect-without-port-no/2326/4

We currently allow custom metadata to be configured with the headers parameter:

case "headers":
rawHeaders, ok := v.(map[string]interface{})
if !ok {
return nil, errors.New("headers must be an object with key-value pairs")
}
for hk, kv := range rawHeaders {
// TODO(rogchap): Should we manage a string slice?
strVal, ok := kv.(string)
if !ok {
return nil, fmt.Errorf("header %q value must be a string", hk)
}
ctx = metadata.AppendToOutgoingContext(ctx, hk, strVal)
}

But even though that might reflect the gRPC implementation details, its proper terminology and parameter name should probably be metadata:

@na-- na-- added enhancement ux evaluation needed proposal needs to be validated or tested before fully implementing it in k6 breaking change for PRs that need to be mentioned in the breaking changes section of the release notes labels Nov 17, 2021
@na-- na-- added this to the v0.37.0 milestone Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change for PRs that need to be mentioned in the breaking changes section of the release notes enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 ux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant