tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/util RequestUtil.java
Date Tue, 02 May 2000 22:02:23 GMT
craigmcc    00/05/02 15:02:23

  Modified:    proposals/catalina/src/share/org/apache/tomcat/connector
                        HttpRequestBase.java ResponseBase.java
               proposals/catalina/src/share/org/apache/tomcat/util
                        RequestUtil.java
  Log:
  Correct Watchdog failures on the following tests:
    org.apache.jcheck.servlet.client.javax_servlet_http.HttpServletRequest.GetHeaders_01Test
    org.apache.jcheck.servlet.client.javax_servlet.ServletRequest.GetCharacterEncoding_1Test
  
  Revision  Changes    Path
  1.7       +13 -6     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpRequestBase.java
  
  Index: HttpRequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpRequestBase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HttpRequestBase.java	2000/04/23 01:42:30	1.6
  +++ HttpRequestBase.java	2000/05/02 22:02:22	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpRequestBase.java,v
1.6 2000/04/23 01:42:30 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/04/23 01:42:30 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/HttpRequestBase.java,v
1.7 2000/05/02 22:02:22 craigmcc Exp $
  + * $Revision: 1.7 $
  + * $Date: 2000/05/02 22:02:22 $
    *
    * ====================================================================
    *
  @@ -92,7 +92,7 @@
    * be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2000/04/23 01:42:30 $
  + * @version $Revision: 1.7 $ $Date: 2000/05/02 22:02:22 $
    */
   
   public class HttpRequestBase
  @@ -122,6 +122,13 @@
   
   
       /**
  +     * An empty Vector to use for returning empty Enumerations.  Do not
  +     * add any elements to this Vector!
  +     */
  +    protected Vector empty = new Vector();
  +
  +
  +    /**
        * The set of SimpleDateFormat formats to use in getDateHeader().
        */
       protected static SimpleDateFormat formats[] = {
  @@ -725,7 +732,7 @@
   
       /**
        * Return all of the values of the specified header, if any; otherwise,
  -     * return <code>null</code>.
  +     * return an empty enumeration.
        *
        * @param name Name of the requested header
        */
  @@ -735,7 +742,7 @@
   	if (values != null)
   	    return (values.elements());
   	else
  -	    return (null);
  +	    return (empty.elements());
   
       }
   
  
  
  
  1.8       +10 -7     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseBase.java
  
  Index: ResponseBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseBase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ResponseBase.java	2000/04/30 01:23:20	1.7
  +++ ResponseBase.java	2000/05/02 22:02:22	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseBase.java,v
1.7 2000/04/30 01:23:20 craigmcc Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/04/30 01:23:20 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/ResponseBase.java,v
1.8 2000/05/02 22:02:22 craigmcc Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/05/02 22:02:22 $
    *
    * ====================================================================
    *
  @@ -87,7 +87,7 @@
    * the connector-specific methods need to be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.7 $ $Date: 2000/04/30 01:23:20 $
  + * @version $Revision: 1.8 $ $Date: 2000/05/02 22:02:22 $
    */
   
   public abstract class ResponseBase
  @@ -142,7 +142,7 @@
       /**
        * The character encoding associated with this Response.
        */
  -    protected String encoding = RequestUtil.parseCharacterEncoding(null);
  +    protected String encoding = "ISO-8859-1";
   
   
       /**
  @@ -356,7 +356,7 @@
   	contentLength = -1;
   	contentType = "text/plain";
   	context = null;
  -	encoding = RequestUtil.parseCharacterEncoding(null);
  +	encoding = "ISO-8859-1";
   	locale = Locale.getDefault();
   	output = null;
   	request = null;
  @@ -554,8 +554,11 @@
   	if (isCommitted())
   	    return;
   	this.contentType = type;
  -	if (type.indexOf(";") >= 0)
  +	if (type.indexOf(";") >= 0) {
   	    encoding = RequestUtil.parseCharacterEncoding(type);
  +	    if (encoding == null)
  +	        encoding = "ISO-8859-1";
  +	}
   
       }
   
  
  
  
  1.3       +7 -7      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/util/RequestUtil.java
  
  Index: RequestUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/util/RequestUtil.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RequestUtil.java	2000/04/17 18:39:50	1.2
  +++ RequestUtil.java	2000/05/02 22:02:23	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/util/RequestUtil.java,v
1.2 2000/04/17 18:39:50 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/04/17 18:39:50 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/util/RequestUtil.java,v
1.3 2000/05/02 22:02:23 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/05/02 22:02:23 $
    *
    * ====================================================================
    *
  @@ -77,7 +77,7 @@
    * General purpose request parsing and encoding utility methods.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2000/04/17 18:39:50 $
  + * @version $Revision: 1.3 $ $Date: 2000/05/02 22:02:23 $
    */
   
   public final class RequestUtil {
  @@ -139,17 +139,17 @@
       /**
        * Parse the character encoding from the specified content type header.
        * If the content type is null, or there is no explicit character encoding,
  -     * ISO-8859-1 is returned.
  +     * <code>null</code> is returned.
        *
        * @param contentType a content type header
        */
       public static String parseCharacterEncoding(String contentType) {
   
   	if (contentType == null)
  -	    return ("ISO-8859-1");
  +	    return (null);
   	int start = contentType.indexOf("charset=");
   	if (start < 0)
  -	    return ("ISO-8859-1");
  +	    return (null);
   	String encoding = contentType.substring(start + 8);
   	int end = encoding.indexOf(";");
   	if (end >= 0)
  
  
  

Mime
View raw message