Author: remy.maucherat(a)jboss.com
Date: 2007-11-26 10:24:43 -0500 (Mon, 26 Nov 2007)
New Revision: 353
Modified:
trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
trunk/webapps/docs/changelog.xml
Log:
- Improve error codes when no host or no context is matched.
Modified: trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2007-11-26 13:20:42 UTC
(rev 352)
+++ trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2007-11-26 15:24:43 UTC
(rev 353)
@@ -444,6 +444,17 @@
request.setContext((Context) request.getMappingData().context);
request.setWrapper((Wrapper) request.getMappingData().wrapper);
+ if (request.getMappingData().host == null) {
+ res.setStatus(400);
+ res.setMessage("Host not mapped");
+ return false;
+ }
+ if (request.getMappingData().context == null) {
+ res.setStatus(404);
+ res.setMessage("Context not mapped");
+ return false;
+ }
+
// Filter trace method
if (!connector.getAllowTrace()
&& req.method().equalsIgnoreCase("TRACE")) {
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2007-11-26 13:20:42 UTC (rev 352)
+++ trunk/webapps/docs/changelog.xml 2007-11-26 15:24:43 UTC (rev 353)
@@ -77,6 +77,9 @@
<fix>
Fix invoking CometEvent.close during begin. (remm)
</fix>
+ <fix>
+ Improve error codes returned when no host or no context is matched. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
Show replies by date