@Test public void shouldNotSendAServerHeaderForSecurityReasons() throws Exception { assertThat(configuration.getSendServerVersion(), is(false)); } }
@Test public void shouldNotSendAServerHeaderForSecurityReasons() throws Exception { HttpConnectionFactory httpConnectionFactory = getHttpConnectionFactory(sslSocketConnector.getConnector().getConnectionFactories()); HttpConfiguration configuration = httpConnectionFactory.getHttpConfiguration(); assertThat(configuration.getSendServerVersion(), is(false)); }
public void writePoweredBy(Appendable out,String preamble,String postamble) throws IOException { if (getSendServerVersion()) { if (preamble!=null) out.append(preamble); out.append(Jetty.POWERED_BY); if (postamble!=null) out.append(postamble); } }
public void writePoweredBy(Appendable out,String preamble,String postamble) throws IOException { if (getSendServerVersion()) { if (preamble!=null) out.append(preamble); out.append(Jetty.POWERED_BY); if (postamble!=null) out.append(postamble); } }
protected HttpGenerator newHttpGenerator() { return new HttpGenerator(_config.getSendServerVersion(),_config.getSendXPoweredBy()); }
protected HttpGenerator newHttpGenerator() { return new HttpGenerator(_config.getSendServerVersion(),_config.getSendXPoweredBy()); }
protected HttpGenerator newHttpGenerator() { return new HttpGenerator(_config.getSendServerVersion(),_config.getSendXPoweredBy()); }
private boolean getSendServerVersion(Connector connector) { ConnectionFactory connFactory = connector.getConnectionFactory(HttpVersion.HTTP_1_1.asString()); if (connFactory == null) return false; if (connFactory instanceof HttpConnectionFactory) { HttpConfiguration httpConf = ((HttpConnectionFactory) connFactory).getHttpConfiguration(); if (httpConf != null) return httpConf.getSendServerVersion(); } return false; }
public HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint) { // Tell AbstractConnector executeOnFillable==true because we want the same thread that // does the HTTP parsing to handle the request so its cache is hot super(endPoint, connector.getExecutor(),true); _config = config; _connector = connector; _bufferPool = _connector.getByteBufferPool(); _generator = new HttpGenerator(); _generator.setSendServerVersion(_config.getSendServerVersion()); _channel = new HttpChannelOverHttp(connector, config, endPoint, this, new Input()); _parser = newHttpParser(); LOG.debug("New HTTP Connection {}", this); }
public HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint) { // Tell AbstractConnector executeOnFillable==true because we want the same thread that // does the HTTP parsing to handle the request so its cache is hot super(endPoint, connector.getExecutor(),true); _config = config; _connector = connector; _bufferPool = _connector.getByteBufferPool(); _generator = new HttpGenerator(); _generator.setSendServerVersion(_config.getSendServerVersion()); _channel = new HttpChannelOverHttp(connector, config, endPoint, this, new Input()); _parser = newHttpParser(); LOG.debug("New HTTP Connection {}", this); }
if (configuration.getSendServerVersion()) headers.add(HttpHeader.SERVER.asString(), HttpConfiguration.SERVER_VERSION); if (configuration.getSendXPoweredBy())
if (getHttpConfiguration().getSendServerVersion()) response.add(SERVER_VERSION); if (getHttpConfiguration().getSendXPoweredBy())