hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenh...@apache.org
Subject hbase git commit: HBASE-15120 Use appropriate encoding for "filter" field in TaskMonitorTmpl.jamon.
Date Wed, 17 Feb 2016 02:25:13 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 c5c45053e -> 553355015


HBASE-15120 Use appropriate encoding for "filter" field in TaskMonitorTmpl.jamon.

Signed-off-by: chenheng <chenheng@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/55335501
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/55335501
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/55335501

Branch: refs/heads/branch-1.2
Commit: 5533550156b627da905b04702887245c2d505307
Parents: c5c4505
Author: Samir Ahmic <samir@personal.com>
Authored: Tue Feb 16 12:04:37 2016 +0100
Committer: chenheng <chenheng@apache.org>
Committed: Wed Feb 17 10:24:58 2016 +0800

----------------------------------------------------------------------
 .../hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon      | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/55335501/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon
index b4a5fea..c3c5d61 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon
@@ -20,12 +20,22 @@ limitations under the License.
 java.util.*;
 org.apache.hadoop.hbase.monitoring.*;
 org.apache.hadoop.util.StringUtils;
+org.owasp.esapi.ESAPI;
+org.owasp.esapi.errors.EncodingException;
 </%import>
 <%args>
 TaskMonitor taskMonitor = TaskMonitor.get();
 String filter = "general";
 String format = "html";
 </%args>
+<%class>
+    public String encodeFilter() {
+    try {
+    return ESAPI.encoder().encodeForURL(filter);
+    }catch(EncodingException e) {}
+    return ESAPI.encoder().encodeForHTML(filter);
+    }
+</%class>
 <%java>
 List<? extends MonitoredTask> tasks = taskMonitor.getTasks();
 Iterator<? extends MonitoredTask> iter = tasks.iterator();
@@ -62,7 +72,7 @@ boolean first = true;
     <li <%if filter.equals("handler")%>class="active"</%if>><a href="?filter=handler">Show
All RPC Handler Tasks</a></li>
     <li <%if filter.equals("rpc")%>class="active"</%if>><a href="?filter=rpc">Show
Active RPC Calls</a></li>
     <li <%if filter.equals("operation")%>class="active"</%if>><a href="?filter=operation">Show
Client Operations</a></li>
-    <li><a href="?format=json&filter=<% filter %>">View as JSON</a></li>
+    <li><a href="?format=json&filter=<% encodeFilter() %>">View as
JSON</a></li>
   </ul>
   <%if tasks.isEmpty()%>
     <p>No tasks currently running on this node.</p>


Mime
View raw message