Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-884

JavaScript rewrite rule results in encoded text

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 0.11.0
    • Fix Version/s: 0.12.0
    • Component/s: Server
    • Labels:
      None

      Description

      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:

      'https://gateway.host:8443/gateway/default/hdfs/datanode?host=%7BinfoAddr%7D'
      

      and this breaks JavaScript code.

      I did some investigation and it seems that the encoding comes from the Expander code:

      private static void appendQueryPart(String part, StringBuilder builder) {
   
          try {
      
              builder.append(URLEncoder.encode(part, "UTF-8"));
    
          } catch ( UnsupportedEncodingException e ) {
      
              builder.append(part);
    
          } 
      }
      

        Attachments

          Activity

            People

            • Assignee:
              rding Richard Ding
              Reporter:
              rding Richard Ding
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: