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 Thu, 20 Dec 2001 12:18:57 GMT
remm        01/12/20 04:18:57

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        DefaultServlet.java
  Log:
  - Fix bug 5497.
    If headers will now be ignored when the default servlet is included.
  
  Revision  Changes    Path
  1.46      +14 -8     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.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- DefaultServlet.java	2001/11/28 21:10:45	1.45
  +++ DefaultServlet.java	2001/12/20 12:18:56	1.46
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.45 2001/11/28 21:10:45 remm Exp $
  - * $Revision: 1.45 $
  - * $Date: 2001/11/28 21:10:45 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.46 2001/12/20 12:18:56 remm Exp $
  + * $Revision: 1.46 $
  + * $Date: 2001/12/20 12:18:56 $
    *
    * ====================================================================
    *
  @@ -124,7 +124,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.45 $ $Date: 2001/11/28 21:10:45 $
  + * @version $Revision: 1.46 $ $Date: 2001/12/20 12:18:56 $
    */
   
   public class DefaultServlet
  @@ -1136,7 +1136,8 @@
           if ((path == null) ||
               path.toUpperCase().startsWith("/WEB-INF") ||
               path.toUpperCase().startsWith("/META-INF")) {
  -            response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
  +            response.sendError(HttpServletResponse.SC_NOT_FOUND, 
  +                               request.getRequestURI());
               return;
           }
   
  @@ -1145,7 +1146,8 @@
           ResourceInfo resourceInfo = new ResourceInfo(path, resources);
   
           if (!resourceInfo.exists) {
  -            response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
  +            response.sendError(HttpServletResponse.SC_NOT_FOUND, 
  +                               request.getRequestURI());
               return;
           }
   
  @@ -1153,7 +1155,8 @@
           // ends with "/" or "\", return NOT FOUND
           if (!resourceInfo.collection) {
               if (path.endsWith("/") || (path.endsWith("\\"))) {
  -                response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
  +                response.sendError(HttpServletResponse.SC_NOT_FOUND, 
  +                                   request.getRequestURI());
                   return;
               }
           }
  @@ -1184,7 +1187,10 @@
           } else {
   
               // Checking If headers
  -            if ( !checkIfHeaders(request, response, resourceInfo) ) {
  +            boolean included =
  +                (request.getAttribute(Globals.REQUEST_URI_ATTR) != null);
  +            if (!included 
  +                && !checkIfHeaders(request, response, resourceInfo)) {
                   return;
               }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message