HeartSaVioR commented on a change in pull request #2950: STORM-3327: Use UTF-8 
for URL encoding in storm-webapp
URL: https://github.com/apache/storm/pull/2950#discussion_r254526989
 
 

 ##########
 File path: storm-webapp/src/main/java/org/apache/storm/daemon/ui/UIHelpers.java
 ##########
 @@ -1312,21 +1326,27 @@ private static Double nullToZero(Double value) {
         Map<String, Object> result = new HashMap();
         ExecutorSummary executorSummary = 
executorAggregateStats.get_exec_summary();
         ExecutorInfo executorInfo = executorSummary.get_executor_info();
-        ComponentAggregateStats componentAggregateStats = 
executorAggregateStats.get_stats();
-        SpecificAggregateStats specificAggregateStats = 
componentAggregateStats.get_specific_stats();
-        BoltAggregateStats boltAggregateStats = 
specificAggregateStats.get_bolt();
-        CommonAggregateStats commonAggregateStats = 
componentAggregateStats.get_common_stats();
         String executorId = prettyExecutorInfo(executorInfo);
         result.put("id", executorId);
-        result.put("encodedId", URLEncoder.encode(executorId));
+        try {
+            result.put("encodedId", URLEncoder.encode(executorId, 
StandardCharsets.UTF_8.name()));
+        } catch (UnsupportedEncodingException e) {
+            throw Utils.wrapInRuntime(e);
+        }
         result.put("uptime", 
prettyUptimeSec(executorSummary.get_uptime_secs()));
         result.put("uptimeSeconds", executorSummary.get_uptime_secs());
         String host = executorSummary.get_host();
         result.put("host", host);
         int port = executorSummary.get_port();
         result.put("port", port);
+        
+        ComponentAggregateStats componentAggregateStats = 
executorAggregateStats.get_stats();
 
 Review comment:
   Ah yes thanks for fixing this too!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to