【发布时间】:2016-09-01 19:53:12
【问题描述】:
我们希望为 spring boot actuator 提供的对 /health 端点的所有 GET 请求启用 Cors。
我们尝试添加以下 bean,但没有成功
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurerAdapter() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/health").allowedMethods("GET");
}
};
}
【问题讨论】:
标签: spring spring-boot cors spring-boot-actuator