You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by la...@apache.org on 2001/12/17 03:30:49 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config NSConfig.java IISConfig.java ApacheConfig.java

larryi      01/12/16 18:30:49

  Modified:    src/share/org/apache/tomcat/modules/config NSConfig.java
                        IISConfig.java ApacheConfig.java
  Log:
  Generate better configuration when forwardAll is false.  The spec says
  the a mapping for "/baz/*" should include "/baz".  For Netscape, better
  protect WEB-INF and META-INF as well as provide some handling for
  ";jsessionid=".
  
  Revision  Changes    Path
  1.8       +19 -1     jakarta-tomcat/src/share/org/apache/tomcat/modules/config/NSConfig.java
  
  Index: NSConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/NSConfig.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- NSConfig.java	2001/10/08 05:27:18	1.7
  +++ NSConfig.java	2001/12/17 02:30:48	1.8
  @@ -133,7 +133,7 @@
       @author Costin Manolache
       @author Larry Isaacs
       @author Gal Shachor
  -	@version $Revision: 1.7 $
  +	@version $Revision: 1.8 $
    */
   public class NSConfig  extends BaseJkConfig { 
   
  @@ -297,7 +297,9 @@
           objfile.println("#######################################################");		    
           objfile.println("# Protecting the WEB-INF and META-INF directories.");
           objfile.println("#######################################################");		    
  +        objfile.println("PathCheck fn=\"deny-existence\" path=\"*/WEB-INF\""); 
           objfile.println("PathCheck fn=\"deny-existence\" path=\"*/WEB-INF/*\""); 
  +        objfile.println("PathCheck fn=\"deny-existence\" path=\"*/META-INF\""); 
           objfile.println("PathCheck fn=\"deny-existence\" path=\"*/META-INF/*\""); 
           objfile.println();
   
  @@ -312,6 +314,17 @@
           objfile.println("Service fn=\"jk_service\" worker=\""+ jkWorker + "\" path=\"/*\"");
           objfile.println("</Object>");
           objfile.println();
  +
  +        if( !forwardAll ) {
  +            objfile.println("#######################################################");		    
  +            objfile.println("# New object to execute URLs containing \";jsessionid=\"");
  +            objfile.println("#######################################################");		    
  +            objfile.println("<Object ppath=\"*;jsessionid=*\">");
  +            objfile.println("ObjectType fn=force-type type=text/html");
  +            objfile.println("Service fn=\"jk_service\" worker=\""+ jkWorker + "\" path=\"/*\"");
  +            objfile.println("</Object>");
  +            objfile.println();
  +        }
       }
   
       // -------------------- Forward all mode --------------------
  @@ -389,6 +402,11 @@
       protected boolean addMapping( String fullPath, PrintWriter objfile ) {
           if( debug > 0 )
               log( "Adding map for " + fullPath );
  +        if( fullPath.endsWith("/*") ) {
  +            objfile.println("NameTrans fn=\"assign-name\" from=\""
  +                    + fullPath.substring(0, fullPath.length() - 2)
  +                    + "\" name=\"" + objectName + "\""); 
  +        }
           objfile.println("NameTrans fn=\"assign-name\" from=\"" +
                           fullPath + "\" name=\"" + objectName + "\""); 
   	return true;
  
  
  
  1.11      +5 -1      jakarta-tomcat/src/share/org/apache/tomcat/modules/config/IISConfig.java
  
  Index: IISConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/IISConfig.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- IISConfig.java	2001/10/08 05:27:18	1.10
  +++ IISConfig.java	2001/12/17 02:30:48	1.11
  @@ -131,7 +131,7 @@
       @author Costin Manolache
       @author Larry Isaacs
       @author Gal Shachor
  -	@version $Revision: 1.10 $
  +	@version $Revision: 1.11 $
    */
   public class IISConfig extends BaseJkConfig  { 
   
  @@ -345,6 +345,10 @@
       protected boolean addMapping( String fullPath, PrintWriter uri_worker ) {
           if( debug > 0 )
               log( "Adding map for " + fullPath );
  +        if( fullPath.endsWith("/*") ) {
  +            uri_worker.println(fullPath.substring(0, fullPath.length() - 2)
  +                    + "=$(default.worker)" );
  +        }
           uri_worker.println(fullPath + "=$(default.worker)" );
           return true;
       }
  
  
  
  1.29      +7 -2      jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ApacheConfig.java
  
  Index: ApacheConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ApacheConfig.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- ApacheConfig.java	2001/10/08 05:27:18	1.28
  +++ ApacheConfig.java	2001/12/17 02:30:48	1.29
  @@ -1,4 +1,4 @@
  -/* $Id: ApacheConfig.java,v 1.28 2001/10/08 05:27:18 larryi Exp $
  +/* $Id: ApacheConfig.java,v 1.29 2001/12/17 02:30:48 larryi Exp $
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
  @@ -149,7 +149,7 @@
       @author Costin Manolache
       @author Larry Isaacs
       @author Mel Martinez
  -	@version $Revision: 1.28 $ $Date: 2001/10/08 05:27:18 $
  +	@version $Revision: 1.29 $ $Date: 2001/12/17 02:30:48 $
    */
   public class ApacheConfig  extends BaseJkConfig { 
       
  @@ -555,6 +555,11 @@
       protected boolean addMapping( String fullPath, PrintWriter mod_jk ) {
           if( debug > 0 )
               log( "Adding map for " + fullPath );
  +        if( fullPath.endsWith("/*") ) {
  +            mod_jk.println(indent + "JkMount "
  +                    + fullPath.substring(0, fullPath.length() - 2)
  +                    + "  " + jkWorker );
  +        }
   	mod_jk.println(indent + "JkMount " + fullPath + "  " + jkWorker );
   	return true;
       }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>