[
https://issues.apache.org/jira/browse/QPIDJMS-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15805080#comment-15805080
]
ASF subversion and git services commented on QPIDJMS-245:
---------------------------------------------------------
Commit 8485ada970296635fd5868bd73938b27ba0f5a61 in qpid-jms's branch
refs/heads/master from [~tabish121]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-jms.git;h=8485ada ]
QPIDJMS-245 Ensure that encoded values on the URI are handled properly
In some cases the parameters where being encoded or decoded twice or
even an unbalanced number of times leading to corruption of the original
values. Refactor a bit to ensure that we encode values when we create
the URIs and decode when we parse out the options consistently. Adds
some additional tests to cover some of these cases.
> Factory connection string in JNDI properties file will be decoded twice
> resulting to unexpected value
> -----------------------------------------------------------------------------------------------------
>
> Key: QPIDJMS-245
> URL: https://issues.apache.org/jira/browse/QPIDJMS-245
> Project: Qpid JMS
> Issue Type: Bug
> Components: qpid-jms-client
> Affects Versions: 0.11.1
> Environment: Any
> Reporter: Allan Li
> Assignee: Timothy Bish
>
> In JmsConnectionFactory.java, line 390 - 391, method parseQuery(queryString)
> 390 Map<String, String> map =
> PropertyUtil.parseQuery(this.remoteURI.getQuery());
> 391 applyURIOptions(map);
> Code of line 390 will decode the remoteURI twice, the first time is in
> "this.remoteURI.getQuery();", then in method "PropertyUtil.parseQuery"
> (PropertyUtil.java, line 200), it will be decoded again.
> This double-decode will generate wrong value.
> For example, the passed in query string is URL encoded
> "jms.password=lBMflBhWkvVy7zamjCN24tCa%2BHn%2FavVwyRltDI%2Fk8kE%3D". (the
> example is retrieved from a Azure Service Bus SAS key). After the first
> decoding, it gets the right expected value
> "lBMflBhWkvVy7zamjCN24tCa+Hn/avVwyRltDI/k8kE=", but if decoded again, it will
> become "lBMflBhWkvVy7zamjCN24tCa Hn/avVwyRltDI/k8kE=". Basically the '+' is
> decoded to ' '. And this wrong string will be set as connection's password
> and it will fail when connecting to target message server due to wrong
> password.
> Using getRawQuery() instead of getQuery() should fix this issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]