You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2019/10/16 09:45:20 UTC
[GitHub] [camel-k-runtime] nicolaferraro commented on a change in pull
request #161: knative: add some checks about supported http methods and
mandatory body
nicolaferraro commented on a change in pull request #161: knative: add some checks about supported http methods and mandatory body
URL: https://github.com/apache/camel-k-runtime/pull/161#discussion_r335377737
##########
File path: camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumerDispatcher.java
##########
@@ -167,6 +168,15 @@ protected void doStop() throws Exception {
@Override
public void handle(HttpServerRequest request) {
+ if (request.method() != HttpMethod.POST) {
+ HttpServerResponse response = request.response();
+ response.setStatusCode(405);
+ response.putHeader(Exchange.CONTENT_TYPE, "text/plain");
+ response.end("Unsupported method: " + request.method());
Review comment:
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")
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services