You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2017/09/21 10:23:01 UTC
svn commit: r1809143 -
/tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
Author: markt
Date: Thu Sep 21 10:23:00 2017
New Revision: 1809143
URL: http://svn.apache.org/viewvc?rev=1809143&view=rev
Log:
No need to separately add '/' if the name ends in '.' since normalize() does that and does so more accurately.
Modified:
tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
Modified: tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java?rev=1809143&r1=1809142&r2=1809143&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java Thu Sep 21 10:23:00 2017
@@ -90,10 +90,7 @@ public abstract class AbstractFileResour
// point. The purpose of this code is to check in a case
// sensitive manner, the path to the resource under base
// agrees with what was requested
- String fileAbsPath = file.getAbsolutePath();
- if (fileAbsPath.endsWith("."))
- fileAbsPath = fileAbsPath + '/';
- String absPath = normalize(fileAbsPath);
+ String absPath = normalize(file.getAbsolutePath());
if ((absoluteBase.length() < absPath.length())
&& (canonicalBase.length() < canPath.length())) {
absPath = absPath.substring(absoluteBase.length() + 1);
@@ -152,11 +149,7 @@ public abstract class AbstractFileResour
fileBase = new File(getBase(), getInternalPath());
checkType(fileBase);
- String absolutePath = fileBase.getAbsolutePath();
- if (absolutePath.endsWith(".")) {
- absolutePath = absolutePath + '/';
- }
- this.absoluteBase = normalize(absolutePath);
+ this.absoluteBase = normalize(fileBase.getAbsolutePath());
try {
this.canonicalBase = fileBase.getCanonicalPath();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org