Claus Ibsen created CAMEL-26058:
-----------------------------------

             Summary: camel-vertx-http - a Path body fails, and a urlencoded 
form keeps its escapes
                 Key: CAMEL-26058
                 URL: https://issues.apache.org/jira/browse/CAMEL-26058
             Project: Camel
          Issue Type: Bug
          Components: camel-vertx-http
    Affects Versions: 4.18.0, 4.22.0, 4.23.0
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while adding the catalog body types of vertx-http (CAMEL-24961), checked 
with {{camel run}} against a platform-http server.

h4. 1. A Path body fails

Only a {{java.io.File}} or a {{WrappedFile}} body is read as a file 
({{VertxHttpProducer}}, main 5aac7df76b83, line 98); another body must convert 
to a Vert.x Buffer (line 150), and a {{java.nio.file.Path}} or a Reader does 
not, where camel-http sends them. Checked on 4.24.0-SNAPSHOT with {{camel 
run}}: a Path body failed with {{InvalidPayloadException: No body available of 
type: io.vertx.core.buffer.Buffer but has type: sun.nio.fs.UnixPath}}.

*Proposed change*: read a Path, and a Reader, as the body.

h4. 2. A urlencoded form keeps its escapes

A String body with the Content-Type application/x-www-form-urlencoded is parsed 
with {{URISupport.parseQuery}} (line 128), which keeps the %XX escapes, and 
Vert.x encodes the form again. Checked on 4.24.0-SNAPSHOT with {{camel run}}: 
"q=a%26b" arrived as {{a%26b}} at the server, not "a&b". A repeated name is 
sent once, with both values as one text (read in the code).

*Proposed change*: decode the values when parsing the form.

h4. Also read in the code, not run

* A Content-Encoding header is forwarded, but the body is not compressed.
* The docs say 100..299 is the default okStatusCodeRange, which is 200-299.
* A serialized response without allowJavaSerializedObject gives a null body 
without a word.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to