Merge branch '2.1.x'

Closes gh-17813
This commit is contained in:
Stephane Nicoll 2019-08-08 16:33:31 +02:00
commit b8a1043e98
2 changed files with 32 additions and 0 deletions

View File

@ -148,6 +148,16 @@ class MultipartAutoConfigurationTests {
.isSameAs(this.context.getBean(DispatcherServlet.class).getMultipartResolver());
}
@Test
void webServerWithNonAbsoluteMultipartLocationUndertowConfiguration() {
this.context = new AnnotationConfigServletWebServerApplicationContext(
WebServerWithNonAbsolutePathUndertow.class, BaseConfiguration.class);
this.context.getBean(MultipartConfigElement.class);
verifyServletWorks();
assertThat(this.context.getBean(StandardServletMultipartResolver.class))
.isSameAs(this.context.getBean(DispatcherServlet.class).getMultipartResolver());
}
@Test
void webServerWithMultipartConfigDisabled() {
testWebServerWithCustomMultipartConfigEnabledSetting("false", 0);
@ -365,6 +375,27 @@ class MultipartAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@EnableWebMvc
static class WebServerWithNonAbsolutePathUndertow {
@Bean
MultipartConfigElement multipartConfigElement() {
return new MultipartConfigElement("test/not-absolute");
}
@Bean
UndertowServletWebServerFactory webServerFactory() {
return new UndertowServletWebServerFactory();
}
@Bean
WebController webController() {
return new WebController();
}
}
@Configuration(proxyBeanMethods = false)
static class WebServerWithCustomMultipartResolver {

View File

@ -271,6 +271,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac
configureErrorPages(deployment);
deployment.setServletStackTraces(ServletStackTraces.NONE);
deployment.setResourceManager(getDocumentRootResourceManager());
deployment.setTempDir(createTempDir("undertow"));
deployment.setEagerFilterInit(this.eagerInitFilters);
configureMimeMappings(deployment);
for (UndertowDeploymentInfoCustomizer customizer : this.deploymentInfoCustomizers) {