tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/filters RequestDumperFilter.java
Date Wed, 23 May 2001 22:26:19 GMT
craigmcc    01/05/23 15:26:19

  Modified:    webapps/examples/WEB-INF/classes/filters
                        RequestDumperFilter.java
  Log:
  Deal with the fact that request.getCookies() can return null.
  
  PR: Patch #5 from the "8 Patches" message on 23 May 2001
  Submitted by:	Peter Costello <peterwcostello@yahoo.com>
  
  Revision  Changes    Path
  1.5       +6 -4      jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.java
  
  Index: RequestDumperFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RequestDumperFilter.java	2001/03/17 00:39:30	1.4
  +++ RequestDumperFilter.java	2001/05/23 22:26:17	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.java,v
1.4 2001/03/17 00:39:30 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2001/03/17 00:39:30 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.java,v
1.5 2001/05/23 22:26:17 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2001/05/23 22:26:17 $
    *
    * ====================================================================
    *
  @@ -89,7 +89,7 @@
    * to assist in debugging problems.
    *
    * @author Craig McClanahan
  - * @version $Revision: 1.4 $ $Date: 2001/03/17 00:39:30 $
  + * @version $Revision: 1.5 $ $Date: 2001/05/23 22:26:17 $
    */
   
   public final class RequestDumperFilter implements Filter {
  @@ -183,6 +183,8 @@
   	    HttpServletRequest hrequest = (HttpServletRequest) request;
   	    writer.println("       contextPath=" + hrequest.getContextPath());
   	    Cookie cookies[] = hrequest.getCookies();
  +            if (cookies == null)
  +                cookies = new Cookie[0];
   	    for (int i = 0; i < cookies.length; i++) {
   	        writer.println("            cookie=" + cookies[i].getName() +
   			       "=" + cookies[i].getValue());
  
  
  

Mime
View raw message