Claus Ibsen created CAMEL-22796:
-----------------------------------

             Summary: camel-platform-http-vertx - VertX has hardcoded 
content-type validation
                 Key: CAMEL-22796
                 URL: https://issues.apache.org/jira/browse/CAMEL-22796
             Project: Camel
          Issue Type: Improvement
          Components: camel-platform-http-vertx
            Reporter: Claus Ibsen
             Fix For: 4.17.0


There may be use-cases where Camel apps should let HTTP requests into Camel 
even if they provide a Content-Type that in Rest DSL is not accepted. There can 
be use-cases where you want to process every incoming request regardless and do 
your own validation.

VertX has hardcoded this and always return 415.

For example
{code:java}
        rest()
            .post("/hello")
            .consumes("application/json")
            .clientRequestValidation(false)
            .to("direct:main");
        from("direct:main")
            .log("${headers}")
            .setBody()
                .simple("Hello Camel from ${routeId}"); {code}
 

And then sending XML via
{code:java}
curl -v -X POST -H "Content-Type: application/xml" http://localhost:8080/hello 
{code}
Should be possible.

However to avoid issues with existing application, we may have to come up with 
a new option for vertx to disable this.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to