Explicitly set asyncSupported for reactive servers

Update `JettyReactiveWebServerFactory`/`TomcatReactiveWebServerFactory`
to explicitly set `asyncSupported` to `true`.

Fixes gh-12486
pull/12491/head
Phillip Webb 7 years ago
parent 079851ebb4
commit d1e51d7f98

@ -140,6 +140,7 @@ public class JettyReactiveWebServerFactory extends AbstractReactiveWebServerFact
Server server = new Server(getThreadPool()); Server server = new Server(getThreadPool());
server.addConnector(createConnector(address, server)); server.addConnector(createConnector(address, server));
ServletHolder servletHolder = new ServletHolder(servlet); ServletHolder servletHolder = new ServletHolder(servlet);
servletHolder.setAsyncSupported(true);
ServletContextHandler contextHandler = new ServletContextHandler(server, "", ServletContextHandler contextHandler = new ServletContextHandler(server, "",
false, false); false, false);
contextHandler.addServlet(servletHolder, "/"); contextHandler.addServlet(servletHolder, "/");

@ -131,7 +131,7 @@ public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFac
loader.setLoaderClass(TomcatEmbeddedWebappClassLoader.class.getName()); loader.setLoaderClass(TomcatEmbeddedWebappClassLoader.class.getName());
loader.setDelegate(true); loader.setDelegate(true);
context.setLoader(loader); context.setLoader(loader);
Tomcat.addServlet(context, "httpHandlerServlet", servlet); Tomcat.addServlet(context, "httpHandlerServlet", servlet).setAsyncSupported(true);
context.addServletMappingDecoded("/", "httpHandlerServlet"); context.addServletMappingDecoded("/", "httpHandlerServlet");
host.addChild(context); host.addChild(context);
configureContext(context); configureContext(context);

Loading…
Cancel
Save