From a2b2dc65ad4d71d0d17990308b82e4602f3fcd5b Mon Sep 17 00:00:00 2001 From: Matt Jacobs Date: Sun, 21 Jun 2015 11:42:52 -0700 Subject: [PATCH] Safely handle negative input on the delay input to metrics-stream --- .../metrics/eventstream/HystrixMetricsStreamServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hystrix-contrib/hystrix-metrics-event-stream/src/main/java/com/netflix/hystrix/contrib/metrics/eventstream/HystrixMetricsStreamServlet.java b/hystrix-contrib/hystrix-metrics-event-stream/src/main/java/com/netflix/hystrix/contrib/metrics/eventstream/HystrixMetricsStreamServlet.java index 25513cf9b..eb798eb06 100644 --- a/hystrix-contrib/hystrix-metrics-event-stream/src/main/java/com/netflix/hystrix/contrib/metrics/eventstream/HystrixMetricsStreamServlet.java +++ b/hystrix-contrib/hystrix-metrics-event-stream/src/main/java/com/netflix/hystrix/contrib/metrics/eventstream/HystrixMetricsStreamServlet.java @@ -124,7 +124,7 @@ private void handleRequest(HttpServletRequest request, HttpServletResponse respo try { String d = request.getParameter("delay"); if (d != null) { - delay = Integer.parseInt(d); + delay = Math.max(Integer.parseInt(d), 1); } } catch (Exception e) { // ignore if it's not a number