Andrea Cosentino created CAMEL-25704:
----------------------------------------
Summary: camel-undertow - the producer sends the request path and
query decoded instead of as they are encoded
Key: CAMEL-25704
URL: https://issues.apache.org/jira/browse/CAMEL-25704
Project: Camel
Issue Type: Bug
Components: camel-core, camel-undertow
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
Fix For: 4.24.0, 4.18.6, 4.22.2
The undertow producer builds the path and query of the HTTP request from the
decoded parts of the target URI (URISupport.pathAndQueryOf uses URI.getPath()
and URI.getQuery()). Characters that are percent-encoded in the endpoint URI,
in the CamelHttpPath and CamelHttpQuery headers, or by the rest producer for
query parameters are therefore sent decoded:
- %26 and %3D in a query value become & and =, so one parameter is received as
several
- %2F in a path segment becomes /, and an encoded dot segment becomes a real one
- %20 becomes a space in the request line, which the server rejects
- a non-ASCII character is written as a single byte instead of its UTF-8
encoding
- header values with characters outside ISO-8859-1 are written the same way
The http, netty-http and vertx-http producers send the encoded form. Before
2.19.0 (CAMEL-10929) the undertow producer did too.
Expected: the producer sends the path and query as encoded, with non-ASCII
characters percent-encoded as UTF-8, and rejects a request target or header
value that it cannot send as is. The vertx-websocket client builds its
handshake URI with the same helper (URISupport.pathAndQueryOf) and should be
aligned.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)