|
46 | 46 | import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer;
|
47 | 47 | import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory;
|
48 | 48 | import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
| 49 | +import org.springframework.boot.web.embedded.undertow.UndertowBuilderCustomizer; |
49 | 50 | import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
|
50 | 51 | import org.springframework.boot.web.server.Http2;
|
51 | 52 | import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
@@ -409,6 +410,8 @@ private static class UndertowCustomizer {
|
409 | 410 | protected static void customizeUndertow(final ServerProperties serverProperties,
|
410 | 411 | Environment environment, UndertowServletWebServerFactory factory) {
|
411 | 412 |
|
| 413 | + customizeUndertowHttp2(factory, serverProperties); |
| 414 | + |
412 | 415 | ServerProperties.Undertow undertowProperties = serverProperties.getUndertow();
|
413 | 416 | ServerProperties.Undertow.Accesslog accesslogProperties = undertowProperties
|
414 | 417 | .getAccesslog();
|
@@ -450,6 +453,15 @@ protected static void customizeUndertow(final ServerProperties serverProperties,
|
450 | 453 | .setEagerFilterInit(undertowProperties.isEagerFilterInit()));
|
451 | 454 | }
|
452 | 455 |
|
| 456 | + private static void customizeUndertowHttp2(UndertowServletWebServerFactory factory, |
| 457 | + ServerProperties serverProperties) { |
| 458 | + |
| 459 | + Http2 http2Properties = serverProperties.getHttp2(); |
| 460 | + factory.addBuilderCustomizers((UndertowBuilderCustomizer) builder -> { |
| 461 | + builder.setServerOption(UndertowOptions.ENABLE_HTTP2, http2Properties.isEnabled()); |
| 462 | + }); |
| 463 | + } |
| 464 | + |
453 | 465 | private static void customizeConnectionTimeout(
|
454 | 466 | UndertowServletWebServerFactory factory, final int connectionTimeout) {
|
455 | 467 | factory.addBuilderCustomizers((builder) -> builder.setSocketOption(
|
|
0 commit comments