tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1822287 - in /tomcat/trunk: java/org/apache/catalina/connector/CoyoteAdapter.java webapps/docs/changelog.xml
Date Fri, 26 Jan 2018 12:41:04 GMT
Author: markt
Date: Fri Jan 26 12:41:04 2018
New Revision: 1822287

URL: http://svn.apache.org/viewvc?rev=1822287&view=rev
Log:
Pass 404 errors triggered by a missing ROOT web application to the container error handling
to generate the response body.

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
    tomcat/trunk/webapps/docs/changelog.xml

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=1822287&r1=1822286&r2=1822287&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Fri Jan 26 12:41:04
2018
@@ -682,15 +682,11 @@ public class CoyoteAdapter implements Ad
             // 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");
-                // No context, so use host
-                Host host = request.getHost();
-                // Make sure there is a host (might not be during shutdown)
-                if (host != null) {
-                    host.logAccess(request, response, 0, true);
-                }
-                return false;
+                response.sendError(404, "Not found");
+                // Allow processing to continue.
+                // If present, the error reporting valve will provide a response
+                // body.
+                return true;
             }
 
             // Now we have the context, we can parse the session ID from the URL

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1822287&r1=1822286&r2=1822287&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Jan 26 12:41:04 2018
@@ -75,6 +75,10 @@
         error handling and/or the container provided error handling
         (<code>ErrorReportValve</code>) as appropriate. (markt)
       </add>
+      <add>
+        Pass 404 errors triggered by a missing ROOT web application to the
+        container error handling to generate the response body. (markt)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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


Mime
View raw message