[
https://issues.apache.org/jira/browse/KNOX-884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15868875#comment-15868875
]
Richard Ding commented on KNOX-884:
-----------------------------------
After removing encoding from _appendQueryPart_ method, all Knox unit tests
passed except one:
{code}
ExpanderTest.testValuelessQueryParamParsingAndExpansionBugKnox599Knox447()
{code}
> JavaScript rewrite rule results in encoded text
> -----------------------------------------------
>
> Key: KNOX-884
> URL: https://issues.apache.org/jira/browse/KNOX-884
> Project: Apache Knox
> Issue Type: Bug
> Components: Server
> Affects Versions: 0.11.0
> Reporter: Richard Ding
> Assignee: Richard Ding
> Fix For: 0.12.0
>
>
> Hadoop added links to datanode web UI in namenode datanodes page (HDFS-10440
> & HDFS-10493) in the form of JavaScript. In Knox we added rewrite rules to
> map JS text '//{infoAddr}' to
> 'https://gateway.host:8443/gateway/default/hdfs/datanode?host={infoAddr}'.
> This works with Knox 0.7. But in Knox 0.11, the same rule results in the
> encoded query segment:
> {code}
> 'https://gateway.host:8443/gateway/default/hdfs/datanode?host=%7BinfoAddr%7D'
> {code}
> and this breaks JavaScript code.
> I did some investigation and it seems that the encoding comes from the
> Expander code:
> {code}
> private static void appendQueryPart(String part, StringBuilder builder) {
> try {
> builder.append(URLEncoder.encode(part, "UTF-8"));
> } catch ( UnsupportedEncodingException e ) {
> builder.append(part);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)