You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "James Netherton (Jira)" <ji...@apache.org> on 2023/01/23 12:16:00 UTC
[jira] [Created] (CAMEL-18967) camel-platform-http-vertx: Improve handling of whether an HTTP request body is allowed or not
James Netherton created CAMEL-18967:
---------------------------------------
Summary: camel-platform-http-vertx: Improve handling of whether an HTTP request body is allowed or not
Key: CAMEL-18967
URL: https://issues.apache.org/jira/browse/CAMEL-18967
Project: Camel
Issue Type: Improvement
Components: camel-platform-http-vertx
Reporter: James Netherton
Assignee: James Netherton
Fix For: 3.20.2, 3.21.0, 4.0
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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)