-
Notifications
You must be signed in to change notification settings - Fork 224
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
fix EventReceiver does not propagate request context #540
fix EventReceiver does not propagate request context #540
Conversation
Signed-off-by: Mitsuo Heijo <mitsuo.heijo@gmail.com>
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.
Small nits, but lgtm
v2/client/http_receiver_test.go
Outdated
}) | ||
} | ||
|
||
handler := func(ctx context.Context) error { |
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.
can you rename this variable to eventReceiver
?
v2/client/http_receiver_test.go
Outdated
if err != nil { | ||
t.Fatal(err) | ||
} | ||
rh, err := client.NewHTTPReceiveHandler(context.Background(), p, handler) |
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.
and rename this with httpHandler
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Oh, sorry I was wrong, conflicts with above.
v2/client/http_receiver_test.go
Outdated
ctx = cloudevents.ContextWithTarget(ctx, ts.URL+"/test") | ||
|
||
result := c.Send(ctx, event) | ||
if cloudevents.IsNACK(result) || !cloudevents.IsACK(result) { |
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.
you can change this with
require.True(t, cloudevents.IsACK(result))
Signed-off-by: Mitsuo Heijo <mitsuo.heijo@gmail.com>
Thanks for your reviewing, has fixed. |
Fix bug the context value set by HTTP middleware etc. was not propagated to the handler.
Signed-off-by: Mitsuo Heijo mitsuo.heijo@gmail.com