commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1531948 - /commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringController.java
Date Mon, 14 Oct 2013 15:55:33 GMT
Author: rmannibucau
Date: Mon Oct 14 15:55:33 2013
New Revision: 1531948

URL: http://svn.apache.org/r1531948
Log:
avoid index exception

Modified:
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringController.java

Modified: commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringController.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringController.java?rev=1531948&r1=1531947&r2=1531948&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringController.java
(original)
+++ commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringController.java
Mon Oct 14 15:55:33 2013
@@ -104,7 +104,9 @@ public class MonitoringController implem
 
         final String baseUri = httpRequest.getContextPath() + mapping;
         request.setAttribute("baseUri", baseUri);
-        String path = httpRequest.getRequestURI().substring(baseUri.length() + 1);
+
+        final String requestURI = httpRequest.getRequestURI();
+        String path = requestURI.substring(Math.max(baseUri.length() + 1, requestURI.length()));
         if (!path.startsWith("/")) {
             path = "/" + path;
         }



Mime
View raw message