Correctly validate context path so sessions can be viewed for ROOT webapp
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 25 Nov 2010 10:19:33 +0000 (10:19 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 25 Nov 2010 10:19:33 +0000 (10:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1038981 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/manager/HTMLManagerServlet.java
webapps/docs/changelog.xml

index d25d106..187426c 100644 (file)
@@ -868,7 +868,7 @@ public final class HTMLManagerServlet extends ManagerServlet {
 
     protected List<Session> getSessionsForName(ContextName cn,
             StringManager smClient) {
-        if ((cn == null) || (!cn.getPath().startsWith("/") &&
+        if ((cn == null) || !(cn.getPath().startsWith("/") ||
                 cn.getPath().equals(""))) {
             String path = null;
             if (cn != null) {
@@ -905,7 +905,7 @@ public final class HTMLManagerServlet extends ManagerServlet {
     }
     protected Session getSessionForNameAndId(ContextName cn, String id,
             StringManager smClient) throws IOException {
-        if ((cn == null) || (!cn.getPath().startsWith("/") &&
+        if ((cn == null) || !(cn.getPath().startsWith("/") ||
                 cn.getPath().equals(""))) {
             String path = null;
             if (cn != null) {
index 44b4657..954e0f8 100644 (file)
         <bug>50294</bug>: Add more information to documentation regarding format
         of configuration files. Patch provided by Luke Meyer. (markt) 
       </add>
+      <fix>
+        Correct validate provided context path so sessions for the ROOT web
+        application can be viewed through the HTML Manager. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">