Skip to content

Conversation

@jcrossley3
Copy link
Contributor

@jcrossley3 jcrossley3 commented Jun 25, 2021

Simplify the handler and its tests by using the latest release of the cloudevents-sdk, since they can be written in terms of Events rather than all the HTTP plumbing abstractions.

This should simplify the unit tests. Only the invalid_event test uses
the actix-web test helpers, just as an example to show it's the HTTP
plumbing that will fail the request when it tries to construct an
Event from invalid (or missing) headers.
@jcrossley3 jcrossley3 marked this pull request as ready for review July 8, 2021 15:16
Copy link
Contributor

@lance lance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a Rust naif, I'll have to trust that this is correct and idiomatic - as I'm sure it is. This looks much nicer anyway.

pub async fn handle(event: Event) -> Result<Event, actix_web::Error> {

@lance lance merged commit c2c1b99 into knative:main Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants