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

knative: add some checks about supported http methods and mandatory body #161

Merged
merged 1 commit into from
Oct 16, 2019

Conversation

lburgazzoli
Copy link
Contributor

No description provided.

HttpServerResponse response = request.response();
response.setStatusCode(405);
response.putHeader(Exchange.CONTENT_TYPE, "text/plain");
response.end("Unsupported method: " + request.method());
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if we need to ask people to manually set "POST" or we should do it for them.
They're sending data to a knative endpoint that wraps HTTP after all.

I'm thinking to simple bridging integrations:

rest().put("/person/{id}").to("knative:event/person")

Copy link
Contributor Author

@lburgazzoli lburgazzoli Oct 16, 2019

Choose a reason for hiding this comment

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

The component does it by default, in your case you want to "put" an event to the broker and the underlying transport implementation will hit a POST to the target knative service.

This check is on the consumer side to restrict the methods we support

@nicolaferraro nicolaferraro merged commit ca2e1dc into apache:master Oct 16, 2019
@lburgazzoli lburgazzoli deleted the knative-http-hardening branch October 16, 2019 10:04
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