Author: jfrederic.clere(a)jboss.com
Date: 2012-08-06 12:37:53 -0400 (Mon, 06 Aug 2012)
New Revision: 2057
Modified:
branches/7.0.x/java/org/apache/catalina/connector/CoyoteAdapter.java
Log:
Fix for JBPAPP-9314.
Modified: branches/7.0.x/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- branches/7.0.x/java/org/apache/catalina/connector/CoyoteAdapter.java 2012-07-26
14:09:13 UTC (rev 2056)
+++ branches/7.0.x/java/org/apache/catalina/connector/CoyoteAdapter.java 2012-08-06
16:37:53 UTC (rev 2057)
@@ -55,6 +55,7 @@
import org.apache.catalina.Context;
import org.apache.catalina.Globals;
+import org.apache.catalina.Host;
import org.apache.catalina.Manager;
import org.apache.catalina.Session;
import org.apache.catalina.Wrapper;
@@ -545,11 +546,13 @@
res.setMessage("Context not mapped");
return false;
}
- if (connector.getAllowedHosts() != null
- &&
!connector.getAllowedHosts().contains(request.getMappingData().host)) {
- res.setStatus(403);
- res.setMessage("Host access is forbidden through this connector");
- return false;
+ if (connector.getAllowedHosts() != null) {
+ Host host = (Host) request.getMappingData().host;
+ if (!connector.getAllowedHosts().contains(host.getName())) {
+ res.setStatus(403);
+ res.setMessage("Host access is forbidden through this
connector");
+ return false;
+ }
}
// Filter trace method
Show replies by date