433572 default to sending date header

This commit is contained in:
Greg Wilkins 2014-04-28 14:50:37 +02:00
parent b186d3eb6e
commit 1e8d8b8b3e
7 changed files with 8 additions and 1 deletions

View File

@ -52,7 +52,7 @@ public class HttpConfiguration
private String _secureScheme = HttpScheme.HTTPS.asString(); private String _secureScheme = HttpScheme.HTTPS.asString();
private boolean _sendServerVersion = true; //send Server: header private boolean _sendServerVersion = true; //send Server: header
private boolean _sendXPoweredBy = false; //send X-Powered-By: header private boolean _sendXPoweredBy = false; //send X-Powered-By: header
private boolean _sendDateHeader = false; //send Date: header private boolean _sendDateHeader = true; //send Date: header
public interface Customizer public interface Customizer
{ {

View File

@ -59,6 +59,7 @@ public class AsyncRequestReadTest
server = new Server(); server = new Server();
connector = new ServerConnector(server); connector = new ServerConnector(server);
connector.setIdleTimeout(10000); connector.setIdleTimeout(10000);
connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration().setSendDateHeader(false);
server.addConnector(connector); server.addConnector(connector);
} }

View File

@ -68,6 +68,7 @@ public class HttpServerTestFixture
protected void startServer(ServerConnector connector) throws Exception protected void startServer(ServerConnector connector) throws Exception
{ {
_connector = connector; _connector = connector;
_connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration().setSendDateHeader(false);
_server.addConnector(_connector); _server.addConnector(_connector);
_server.setHandler(new HandlerWrapper()); _server.setHandler(new HandlerWrapper());
_server.start(); _server.start();

View File

@ -109,6 +109,7 @@ public class SSLEngineTest
http.getHttpConfiguration().setRequestHeaderSize(512); http.getHttpConfiguration().setRequestHeaderSize(512);
connector=new ServerConnector(server, sslContextFactory, http); connector=new ServerConnector(server, sslContextFactory, http);
connector.setPort(0); connector.setPort(0);
connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration().setSendDateHeader(false);
server.addConnector(connector); server.addConnector(connector);
} }

View File

@ -40,6 +40,7 @@ import javax.servlet.http.HttpServletResponseWrapper;
import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.LocalConnector; import org.eclipse.jetty.server.LocalConnector;
import org.eclipse.jetty.server.QuietServletException; import org.eclipse.jetty.server.QuietServletException;
import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Request;
@ -70,6 +71,7 @@ public class AsyncContextTest
_contextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS); _contextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
_connector = new LocalConnector(_server); _connector = new LocalConnector(_server);
_connector.setIdleTimeout(5000); _connector.setIdleTimeout(5000);
_connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration().setSendDateHeader(false);
_server.setConnectors(new Connector[] _server.setConnectors(new Connector[]
{ _connector }); { _connector });

View File

@ -78,6 +78,7 @@ public class DispatcherTest
_server = new Server(); _server = new Server();
_connector = new LocalConnector(_server); _connector = new LocalConnector(_server);
_connector.getConnectionFactory(HttpConfiguration.ConnectionFactory.class).getHttpConfiguration().setSendServerVersion(false); _connector.getConnectionFactory(HttpConfiguration.ConnectionFactory.class).getHttpConfiguration().setSendServerVersion(false);
_connector.getConnectionFactory(HttpConfiguration.ConnectionFactory.class).getHttpConfiguration().setSendDateHeader(false);
_contextCollection = new ContextHandlerCollection(); _contextCollection = new ContextHandlerCollection();
_contextHandler = new ServletContextHandler(); _contextHandler = new ServletContextHandler();

View File

@ -49,6 +49,7 @@ public class InvokerTest
_server = new Server(); _server = new Server();
_connector = new LocalConnector(_server); _connector = new LocalConnector(_server);
_connector.getConnectionFactory(HttpConfiguration.ConnectionFactory.class).getHttpConfiguration().setSendServerVersion(false); _connector.getConnectionFactory(HttpConfiguration.ConnectionFactory.class).getHttpConfiguration().setSendServerVersion(false);
_connector.getConnectionFactory(HttpConfiguration.ConnectionFactory.class).getHttpConfiguration().setSendDateHeader(false);
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
_server.addConnector(_connector); _server.addConnector(_connector);