Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18967

camel-platform-http-vertx: Improve handling of whether an HTTP request body is allowed or not

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      The way that camel-platform-http-vertx tries to determine whether a request can / should have a body is a little bit flawed.

      There is a HttpMethod enum which controls which HTTP method is allowed a body:

      https://github.com/apache/camel/blob/main/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/spi/Method.java#L29-L38

      This is then checked in the platform-http consumer:

      https://github.com/apache/camel/blob/main/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java#L280

      The problem is that it's not in line with how Vert.x web works. It already has its own logic for this. If the request Content-Type is application/x-www-form-urlencoded, then only POST, PUT, PATCH or DELETE is allowed a body. Otherwise no restriction is applied.

      So I think we should drop checking with 'canHaveBody' and just let Vert.x do its own validation.

      Attachments

        Issue Links

          Activity

            People

              jamesnetherton James Netherton
              jamesnetherton James Netherton
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: