Author: mmillson
Date: 2010-09-29 09:51:33 -0400 (Wed, 29 Sep 2010)
New Revision: 1558
Modified:
trunk/java/org/apache/catalina/connector/Response.java
Log:
Add the ability to allow rewriting URLs for other contexts for [JBWEB-181].
Modified: trunk/java/org/apache/catalina/connector/Response.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Response.java 2010-09-29 02:10:17 UTC (rev
1557)
+++ trunk/java/org/apache/catalina/connector/Response.java 2010-09-29 13:51:33 UTC (rev
1558)
@@ -64,6 +64,8 @@
public class Response
implements HttpServletResponse {
+ protected static final boolean REWRITE_CONTEXT_CHECK =
+
Boolean.valueOf(System.getProperty("org.apache.catalina.connector.Response.REWRITE_CONTEXT_CHECK",
"true")).booleanValue();
// ----------------------------------------------------------- Constructors
@@ -1511,7 +1513,7 @@
String contextPath = request.getContext().getPath();
if (contextPath != null) {
String file = url.getFile();
- if ((file == null) || !file.startsWith(contextPath))
+ if ((file == null) || (REWRITE_CONTEXT_CHECK &&
!file.startsWith(contextPath)))
return (false);
String tok = request.getContext().getSessionCookie().getPathParameterName() +
session.getIdInternal();
if (file.indexOf(tok, contextPath.length()) >= 0)
Show replies by date