You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fails because WelcomePageHandlerMapping has a nullCorsConfigurationSource.
Bug 1: WebMvcAutoConfiguration.welcomePageHandlerMapping() does not call WelcomePageHandlerMapping.setCorsConfigurations(getCorsConfigurations()).
WebMvcAutoConfiguration.requestMappingHandlerMapping does call this function (in super.requestMappingHandlerMapping), so for regular requests, CORS is handled correctly. welcomePageHandlerMapping() should do this as well.
Bug 2:
A workaround could involve a custom configuration, or a PostConstruct handler, or something, that called WelcomePageHandlerMapping.setCorsConfigurations().
But WelcomePageHandlerMapping is a non-public class, so there is no clean way to do this.
The text was updated successfully, but these errors were encountered:
I am using spring-boot-autoconfigure version 2.2.5.RELEASE.
I have added CORS mapping in a WebMvcConfiguer in my application:
This works in my test setup, when I load http://localhost/version in an iframe embedded in http://localhost:8123
This fails with a CORS error when I load http://localhost/
This fails because
WelcomePageHandlerMapping
has anull
CorsConfigurationSource
.Bug 1:
WebMvcAutoConfiguration.welcomePageHandlerMapping()
does not callWelcomePageHandlerMapping.setCorsConfigurations(getCorsConfigurations())
.WebMvcAutoConfiguration.requestMappingHandlerMapping
does call this function (insuper.requestMappingHandlerMapping
), so for regular requests, CORS is handled correctly.welcomePageHandlerMapping()
should do this as well.Bug 2:
A workaround could involve a custom configuration, or a
PostConstruct
handler, or something, that calledWelcomePageHandlerMapping.setCorsConfigurations()
.But
WelcomePageHandlerMapping
is a non-public class, so there is no clean way to do this.The text was updated successfully, but these errors were encountered: