|
47 | 47 | import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer; |
48 | 48 | import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; |
49 | 49 | import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; |
| 50 | +import org.springframework.boot.web.embedded.undertow.UndertowBuilderCustomizer; |
50 | 51 | import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; |
51 | 52 | import org.springframework.boot.web.server.Http2; |
52 | 53 | import org.springframework.boot.web.server.WebServerFactoryCustomizer; |
@@ -415,6 +416,8 @@ private static class UndertowCustomizer { |
415 | 416 | protected static void customizeUndertow(final ServerProperties serverProperties, |
416 | 417 | Environment environment, UndertowServletWebServerFactory factory) { |
417 | 418 |
|
| 419 | + customizeUndertowHttp2(factory, serverProperties); |
| 420 | + |
418 | 421 | ServerProperties.Undertow undertowProperties = serverProperties.getUndertow(); |
419 | 422 | ServerProperties.Undertow.Accesslog accesslogProperties = undertowProperties |
420 | 423 | .getAccesslog(); |
@@ -456,6 +459,15 @@ protected static void customizeUndertow(final ServerProperties serverProperties, |
456 | 459 | .setEagerFilterInit(undertowProperties.isEagerFilterInit())); |
457 | 460 | } |
458 | 461 |
|
| 462 | + private static void customizeUndertowHttp2(UndertowServletWebServerFactory factory, |
| 463 | + ServerProperties serverProperties) { |
| 464 | + |
| 465 | + Http2 http2Properties = serverProperties.getHttp2(); |
| 466 | + factory.addBuilderCustomizers((UndertowBuilderCustomizer) builder -> { |
| 467 | + builder.setServerOption(UndertowOptions.ENABLE_HTTP2, http2Properties.isEnabled()); |
| 468 | + }); |
| 469 | + } |
| 470 | + |
459 | 471 | private static void customizeConnectionTimeout( |
460 | 472 | UndertowServletWebServerFactory factory, final int connectionTimeout) { |
461 | 473 | factory.addBuilderCustomizers((builder) -> builder.setSocketOption( |
|
0 commit comments