tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
Date Tue, 09 Oct 2001 02:44:09 GMT
remm        01/10/08 19:44:09

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        DefaultServlet.java
  Log:
  - Port patch: don't set last-modified or parse if headers when serving
    a directory browsing page.
  
  Revision  Changes    Path
  1.41      +21 -18    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- DefaultServlet.java	2001/09/28 02:32:51	1.40
  +++ DefaultServlet.java	2001/10/09 02:44:09	1.41
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.40 2001/09/28 02:32:51 remm Exp $
  - * $Revision: 1.40 $
  - * $Date: 2001/09/28 02:32:51 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.41 2001/10/09 02:44:09 remm Exp $
  + * $Revision: 1.41 $
  + * $Date: 2001/10/09 02:44:09 $
    *
    * ====================================================================
    *
  @@ -122,7 +122,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.40 $ $Date: 2001/09/28 02:32:51 $
  + * @version $Revision: 1.41 $ $Date: 2001/10/09 02:44:09 $
    */
   
   public class DefaultServlet
  @@ -1089,18 +1089,23 @@
                   return;
               }
   
  -        }
  +        } else {
   
  -        // Checking If headers
  -        if ( !checkIfHeaders(request, response, resourceInfo) ) {
  -            return;
  +            // Checking If headers
  +            if ( !checkIfHeaders(request, response, resourceInfo) ) {
  +                return;
  +            }
  +
           }
   
           // Find content type.
           String contentType =
               getServletContext().getMimeType(resourceInfo.path);
   
  +        Vector ranges = null;
  +
           if (resourceInfo.collection) {
  +
               // Skip directory listings if we have been configured to
               // suppress them
               if (!listings) {
  @@ -1109,25 +1114,23 @@
                   return;
               }
               contentType = "text/html;charset=UTF-8";
  -        }
   
  +        } else {
   
  -        // Parse range specifier
  -        Vector ranges = null;
  -        if (!resourceInfo.collection) {
  +            // Parse range specifier
   
               ranges = parseRange(request, response, resourceInfo);
   
               // ETag header
               response.setHeader("ETag", getETag(resourceInfo, true));
   
  -        }
  +            // Last-Modified header
  +            if (debug > 0)
  +                log("DefaultServlet.serveFile:  lastModified='" +
  +                    (new Timestamp(resourceInfo.date)).toString() + "'");
  +            response.setDateHeader("Last-Modified", resourceInfo.date);
   
  -        // Last-Modified header
  -        if (debug > 0)
  -            log("DefaultServlet.serveFile:  lastModified='" +
  -                (new Timestamp(resourceInfo.date)).toString() + "'");
  -        response.setDateHeader("Last-Modified", resourceInfo.date);
  +        }
   
           ServletOutputStream ostream = null;
           PrintWriter writer = null;
  
  
  

Mime
View raw message