tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1509839 - /tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
Date Fri, 02 Aug 2013 20:05:43 GMT
Author: markt
Date: Fri Aug  2 20:05:43 2013
New Revision: 1509839

URL: http://svn.apache.org/r1509839
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55345
Handle ServletContext.getRealPath("") in the same way for tc8 as for earlier versions.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1509839&r1=1509838&r2=1509839&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Fri Aug  2 20:05:43 2013
@@ -4524,6 +4524,11 @@ public class StandardContext extends Con
      */
     @Override
     public String getRealPath(String path) {
+        // The WebResources API expects all paths to start with /. This is a
+        // special case for consistency with earlier Tomcat versions.
+        if ("".equals(path)) {
+            path = "/";
+        }
         if (resources != null) {
             return resources.getResource(path).getCanonicalPath();
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message