You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Ulrich Kramer (JIRA)" <ji...@apache.org> on 2013/11/20 11:26:35 UTC
[jira] [Created] (CAMEL-6986) RAW query parameter doesn't work as
expected
Ulrich Kramer created CAMEL-6986:
------------------------------------
Summary: RAW query parameter doesn't work as expected
Key: CAMEL-6986
URL: https://issues.apache.org/jira/browse/CAMEL-6986
Project: Camel
Issue Type: Bug
Components: camel-core
Affects Versions: 2.11.2
Reporter: Ulrich Kramer
The following test shows the problem.
{code}
@Test
public void testRaw() throws Exception {
final String password = "%7Az";
CamelContext context = new DefaultCamelContext();
context.addComponent("test", new DefaultComponent() {
@Override
protected Endpoint createEndpoint(final String uri, final String remaining,
final Map<String, Object> parameters)
throws Exception {
if (!parameters.remove("password").equals(password)) {
throw new Exception("Invalid password");
}
return new DefaultEndpoint() {
@Override
public Producer createProducer() throws Exception {
return null;
}
@Override
public Consumer createConsumer(final Processor processor) throws Exception {
return null;
}
@Override
public boolean isSingleton() {
return false;
}
};
}
});
context.getEndpoint("test:///?password=RAW(" + password + ")");
}
{code}
With userRawUri it works. But than other parameter must be manually decoded.
In my opinion the raw-feature is not the correct answer to encode passwords. It's not transparent to the user. I think normal URI encoding could do the job, if you implement normalizeEndpointUri with primitive string manipulations and without java.net.URI.
--
This message was sent by Atlassian JIRA
(v6.1#6144)