-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: k6 gRPC middleware #133
base: main
Are you sure you want to change the base?
Conversation
Adding the baggage to the request context makes it easier for users to pass the baggage along in subsequent requests.
ctx := r.Context() | ||
labels := getBaggageLabelsFromContext(ctx) | ||
if labels == nil { | ||
lh.innerHandler.ServeHTTP(w, r) | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be mistaken (couldn't find a test case), but it seems that baggageToLabels
called from getBaggageLabelsFromContext
may return a non-nil empty labels
(LabelSet
), if the baggage only contains non-k6 labels. I would move zero length check to baggageToLabels
, so that we do this after filtering, just in case
Adds a gRPC variant of the HTTP middleware introduced in this PR: #131