You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2001/06/17 00:05:06 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/mappers DecodeInterceptor.java

costin      01/06/16 15:05:06

  Modified:    src/share/org/apache/tomcat/core Context.java
               src/share/org/apache/tomcat/modules/mappers
                        DecodeInterceptor.java
  Log:
  Fixed the decode interceptor - reset the string cache in the buffer, and
  default to null if no encoding is found ( fix the last failure in the
  watchdog ).
  
  On my machine tomcat33 and jasper34 are passing all watchdog and sanity tests.
  
  Revision  Changes    Path
  1.144     +0 -4      jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java,v
  retrieving revision 1.143
  retrieving revision 1.144
  diff -u -r1.143 -r1.144
  --- Context.java	2001/06/16 20:17:54	1.143
  +++ Context.java	2001/06/16 22:05:04	1.144
  @@ -115,10 +115,6 @@
       public static final String ATTRIB_PROTECTION_DOMAIN=
   	"org.apache.tomcat.protection_domain";
       
  -    // public static final String ATTRIB_WORKDIR1 = "javax.servlet.context.tempdir";
  -    // public static final String ATTRIB_WORKDIR2 = "sun.servlet.workdir";
  -    
  -
       /** This attribute will return the real context (
        *  org.apache.tomcat.core.Context).
        *  Only "trusted" applications will get the value. Null if the application
  
  
  
  1.3       +10 -3     jakarta-tomcat/src/share/org/apache/tomcat/modules/mappers/DecodeInterceptor.java
  
  Index: DecodeInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/mappers/DecodeInterceptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DecodeInterceptor.java	2001/05/27 23:14:24	1.2
  +++ DecodeInterceptor.java	2001/06/16 22:05:05	1.3
  @@ -192,7 +192,12 @@
   	if (pathMB.indexOf('%') >= 0 || pathMB.indexOf( '+' ) >= 0) {
   	    try {
   		req.unparsedURI().duplicate( pathMB );
  +		if(debug>1 )
  +		    log( "Before " + pathMB.toString());
   		req.getURLDecoder().convert( pathMB );
  +		pathMB.resetStringValue();
  +		if(debug>1 )
  +		    log( "After " + pathMB.toString());
   		if( pathMB.indexOf( '\0' ) >=0 ) {
   		    return 404; // XXX should be 400 
   		}
  @@ -246,7 +251,7 @@
   		ServerSession sess=req.getSession( false );
   		if( sess!=null ) {
   		    charset=(String)sess.getNote( sessionEncodingNote );
  -		    if( debug>0 && charset!=null )
  +		    if( debug>-1 && charset!=null )
   			log("Charset from session " + charset );
   		}
   	    }
  @@ -255,9 +260,11 @@
   	    
   	    if( charset != null ) return charset;
   	    
  -	    log( "Default getInfo UTF-8" );
  +	    charset=ctx.getProperty("charset");
  +	    if( charset!=null )
  +		log( "Default per context " + charset );
   	    // Use per context default
  -	    return "UTF-8";
  +	    return charset;
   	}
   	return null;
       }