[
https://issues.apache.org/jira/browse/KNOX-884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15868905#comment-15868905
]
Jeffrey E Rodriguez commented on KNOX-884:
-------------------------------------------
Richard, these changes came with https://issues.apache.org/jira/browse/KNOX-673
- "Proxy support for Ambari UI". It would be nice if there was a way to
control whether a query parameter is encoded or not. The issue in your case is
that after URL encoding the JS processor is not able to replace "{infoAddr} "
with the json var. Probably Sumit could expand on this since I think there are
other issues affecting UIs through Knox do to encoding of query parameters.
> 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)