[AMQ-6951] Hide embedded jetty version

- WS transport
 - HTTP transport
This commit is contained in:
Matt Pavlovich 2021-03-02 10:44:40 -06:00
parent 2f40261362
commit 79f1c2feb7
2 changed files with 16 additions and 1 deletions

View File

@ -28,8 +28,9 @@ import org.apache.activemq.transport.util.TextWireFormat;
import org.apache.activemq.transport.xstream.XStreamWireFormat;
import org.apache.activemq.util.ServiceStopper;
import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerWrapper;
import org.eclipse.jetty.servlet.ServletContextHandler;
@ -82,6 +83,12 @@ public class HttpTransportServer extends WebTransportServerSupport {
connector = socketConnectorFactory.createConnector(server);
}
for(ConnectionFactory cf : connector.getConnectionFactories()) {
if(HttpConnectionFactory.class.isAssignableFrom(cf.getClass())) {
HttpConnectionFactory.class.cast(cf).getHttpConfiguration().setSendServerVersion(false);
}
}
URI boundTo = bind();
ServletContextHandler contextHandler =

View File

@ -32,7 +32,9 @@ import org.apache.activemq.transport.ws.jetty9.WSServlet;
import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.util.ServiceStopper;
import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
@ -64,6 +66,12 @@ public class WSTransportServer extends WebTransportServerSupport implements Brok
connector = socketConnectorFactory.createConnector(server);
}
for(ConnectionFactory cf : connector.getConnectionFactories()) {
if(HttpConnectionFactory.class.isAssignableFrom(cf.getClass())) {
HttpConnectionFactory.class.cast(cf).getHttpConfiguration().setSendServerVersion(false);
}
}
URI boundTo = bind();
ServletContextHandler contextHandler =