You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2003/11/16 05:19:04 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteAdapter.java

billbarker    2003/11/15 20:19:04

  Modified:    catalina/src/share/org/apache/coyote/tomcat5
                        CoyoteAdapter.java
  Log:
  Allow postParseRequest to deny a Request without the nasty throw.
  
  Revision  Changes    Path
  1.14      +10 -8     jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CoyoteAdapter.java	18 Sep 2003 22:20:51 -0000	1.13
  +++ CoyoteAdapter.java	16 Nov 2003 04:19:03 -0000	1.14
  @@ -200,7 +200,9 @@
           try {
               // Parse and set Catalina and configuration specific 
               // request parameters
  -            postParseRequest(req, request, res, response);
  +            if( !postParseRequest(req, request, res, response) ) {
  +                return;
  +            }
               if (!request.getMappingData().redirectPath.isNull()) {
                   response.sendRedirect
                       (request.getMappingData().redirectPath.toString());
  @@ -230,7 +232,7 @@
       /**
        * Parse additional request parameters.
        */
  -    protected void postParseRequest(Request req, CoyoteRequest request,
  +    protected boolean postParseRequest(Request req, CoyoteRequest request,
                                       Response res, CoyoteResponse response)
           throws Exception {
           // XXX the processor needs to set a correct scheme and port prior to this point, 
  @@ -277,7 +279,7 @@
           if (!normalize(req.decodedURI())) {
               res.setStatus(400);
               res.setMessage("Invalid URI");
  -            throw new IOException("Invalid URI");
  +            return false;
           }
   
           // Set the remote principal
  @@ -310,7 +312,7 @@
   
           // Parse cookies
           parseCookies(req, request);
  -
  +        return true;
       }
   
   
  
  
  

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