tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1031709 - /tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
Date Fri, 05 Nov 2010 18:49:28 GMT
Author: markt
Date: Fri Nov  5 18:49:28 2010
New Revision: 1031709

URL: http://svn.apache.org/viewvc?rev=1031709&view=rev
Log:
Parallel deployment
Re-order postParseRequest in preparation for patch that does the real parallel deployment
work
The order may look a little odd now, all will be clear with the patch

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1031709&r1=1031708&r2=1031709&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Fri Nov  5 18:49:28
2010
@@ -575,33 +575,6 @@ public class CoyoteAdapter implements Ad
         request.setContext((Context) request.getMappingData().context);
         request.setWrapper((Wrapper) request.getMappingData().wrapper);
 
-        // Filter trace method
-        if (!connector.getAllowTrace() 
-                && req.method().equalsIgnoreCase("TRACE")) {
-            Wrapper wrapper = request.getWrapper();
-            String header = null;
-            if (wrapper != null) {
-                String[] methods = wrapper.getServletMethods();
-                if (methods != null) {
-                    for (int i=0; i<methods.length; i++) {
-                        if ("TRACE".equals(methods[i])) {
-                            continue;
-                        }
-                        if (header == null) {
-                            header = methods[i];
-                        } else {
-                            header += ", " + methods[i];
-                        }
-                    }
-                }
-            }                               
-            res.setStatus(405);
-            res.addHeader("Allow", header);
-            res.setMessage("TRACE method is not allowed");
-            request.getContext().logAccess(request, response, 0, true);
-            return false;
-        }
-
         // If there is no context at this point, it is likely no ROOT context
         // has been deployed
         if (request.getContext() == null) {
@@ -628,6 +601,10 @@ public class CoyoteAdapter implements Ad
             }
         }
 
+        // Look for session ID in cookies and SSL session
+        parseSessionCookiesId(req, request);
+        parseSessionSslId(request);
+
         // Possible redirect
         MessageBytes redirectPathMB = request.getMappingData().redirectPath;
         if (!redirectPathMB.isNull()) {
@@ -651,9 +628,33 @@ public class CoyoteAdapter implements Ad
             return false;
         }
 
-        // Finally look for session ID in cookies and SSL session
-        parseSessionCookiesId(req, request);
-        parseSessionSslId(request);
+        // Filter trace method
+        if (!connector.getAllowTrace() 
+                && req.method().equalsIgnoreCase("TRACE")) {
+            Wrapper wrapper = request.getWrapper();
+            String header = null;
+            if (wrapper != null) {
+                String[] methods = wrapper.getServletMethods();
+                if (methods != null) {
+                    for (int i=0; i<methods.length; i++) {
+                        if ("TRACE".equals(methods[i])) {
+                            continue;
+                        }
+                        if (header == null) {
+                            header = methods[i];
+                        } else {
+                            header += ", " + methods[i];
+                        }
+                    }
+                }
+            }                               
+            res.setStatus(405);
+            res.addHeader("Allow", header);
+            res.setMessage("TRACE method is not allowed");
+            request.getContext().logAccess(request, response, 0, true);
+            return false;
+        }
+
         return true;
     }
 



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


Mime
View raw message