vmassol 01/09/22 07:18:32
Modified: src/framework/share/org/apache/cactus/server
AbstractHttpServletRequestWrapper.java
Log:
bug correction to handle servers for which getRealPath() does not return a trailing
file separator character
Revision Changes Path
1.2 +9 -3
jakarta-cactus/src/framework/share/org/apache/cactus/server/AbstractHttpServletRequestWrapper.java
Index: AbstractHttpServletRequestWrapper.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/src/framework/share/org/apache/cactus/server/AbstractHttpServletRequestWrapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractHttpServletRequestWrapper.java 2001/09/16 18:40:48 1.1
+++ AbstractHttpServletRequestWrapper.java 2001/09/22 14:18:32 1.2
@@ -68,7 +68,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
- * @version $Id: AbstractHttpServletRequestWrapper.java,v 1.1 2001/09/16 18:40:48
vmassol Exp $
+ * @version $Id: AbstractHttpServletRequestWrapper.java,v 1.2 2001/09/22 14:18:32
vmassol Exp $
*/
public abstract class AbstractHttpServletRequestWrapper implements
HttpServletRequest
{
@@ -253,8 +253,14 @@
if (pathInfo != null) {
String newPathInfo = (pathInfo.startsWith("/") ?
pathInfo.substring(1) : pathInfo);
- pathTranslated = this.request.getRealPath("/") +
- newPathInfo.replace('/', File.separatorChar);
+ if (this.request.getRealPath("/").endsWith("/")) {
+ pathTranslated = this.request.getRealPath("/") +
+ newPathInfo.replace('/', File.separatorChar);
+ } else {
+ pathTranslated = this.request.getRealPath("/") +
+ File.separatorChar + newPathInfo.replace('/',
+ File.separatorChar);
+ }
} else {
pathTranslated = this.request.getPathTranslated();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]