Author: markt
Date: Tue Aug 16 12:58:19 2011
New Revision: 1158251

URL: http://svn.apache.org/viewvc?rev=1158251&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41179
Return 404 rather than 400 if no ROOT context is deployed

Modified:
    tomcat/tc5.5.x/trunk/STATUS.txt
    
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/CoyoteAdapter.java
    tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml

Modified: tomcat/tc5.5.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=1158251&r1=1158250&r2=1158251&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/STATUS.txt (original)
+++ tomcat/tc5.5.x/trunk/STATUS.txt Tue Aug 16 12:58:19 2011
@@ -94,12 +94,6 @@ PATCHES PROPOSED TO BACKPORT:
        I think there is not much demand for this feature in 5.5 to justify 
this.
        The rest of changes and fixes are OK to backport (e.g. allow to specify 
port numbers).
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41179
-  Return 404 rather than 400 if no ROOT context is deployed
-  http://people.apache.org/~markt/patches/2011-07-22-bug41179-tc5.patch
-  +1: markt, kfujino, kkolinko
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51647
   Session replication fails with ClassNotFoundException when session attribute
   is Java dynamic proxy

Modified: 
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/CoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/CoyoteAdapter.java?rev=1158251&r1=1158250&r2=1158251&view=diff
==============================================================================
--- 
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/CoyoteAdapter.java
 (original)
+++ 
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/CoyoteAdapter.java
 Tue Aug 16 12:58:19 2011
@@ -311,6 +311,14 @@ public class CoyoteAdapter
         request.setContext((Context) request.getMappingData().context);
         request.setWrapper((Wrapper) request.getMappingData().wrapper);
 
+        // If there is no context at this point, it is likely no ROOT context
+        // has been deployed
+        if (request.getContext() == null) {
+            res.setStatus(404);
+            res.setMessage("Not found");
+            return false;
+        }
+
         // Filter trace method
         if (!connector.getAllowTrace() 
                 && req.method().equalsIgnoreCase("TRACE")) {

Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml?rev=1158251&r1=1158250&r2=1158251&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml (original)
+++ tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml Tue Aug 16 
12:58:19 2011
@@ -51,6 +51,10 @@
         Stephane Bailliez. (mark) 
       </fix>
       <fix>
+        <bug>41179</bug>: Return 404 rather than 400 for requests to the ROOT
+        context when no ROOT context has been deployed. (markt)
+      </fix>
+      <fix>
         <bug>50189</bug>: Once the application has finished writing to the
         response, prevent further reads from the request since this causes
         various problems in the connectors which do not expect this. (markt)



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to