Andrea Cosentino created CAMEL-25787:
----------------------------------------
Summary: camel-smooks - handle Smooks Source bodies like other XML
message bodies
Key: CAMEL-25787
URL: https://issues.apache.org/jira/browse/CAMEL-25787
Project: Camel
Issue Type: Bug
Components: camel-smooks
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
Fix For: 4.24.0, 4.22.3, 4.18.6
{{SmooksProcessor.getSource(Exchange)}} returns a message body that is already
a Smooks {{Source}} ({{org.smooks.api.io.Source}}) unchanged. Other XML bodies
({{String}}, {{byte[]}}, {{InputStream}}, files) are first parsed by
{{SmooksSecuritySupport}} according to {{allowExternalEntities}} when the
configuration uses the default XML reader. This change makes {{Source}} bodies
follow the same path:
* {{StreamSource}}/{{ByteSource}}, {{ReaderSource}}/{{StringSource}} and
{{URLSource}} bodies are parsed into a {{DOMSource}}, keeping the exchange
charset and the system id.
* {{DOMSource}} and {{JavaSource}} bodies are passed on unchanged.
* Other {{Source}} types are rejected unless {{allowExternalEntities=true}}.
h3. Tests
{{SmooksSourceBodyTest}} covers each {{Source}} type, with the option at its
default and set to {{true}}; the existing tests keep passing.
h3. Upgrade guide
4.24.0, 4.22.3 and 4.18.6: {{Source}} bodies follow {{allowExternalEntities}}
like other bodies, and are parsed into a DOM first, which uses more memory for
very large {{StreamSource}} inputs.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)