CORSの許可された起点をSpring yml構成で次のように構成しました。CORSのSpring Yml構成が使用されていません
endpoints:
cors:
allowed-origins: http://client.local
allow-credentials: true
しかし、私はYMLの設定を保持し、Javaの設定を破棄したい
@Configuration
@EnableWebMvc
public class WebConfiguration extends WebMvcConfigurerAdapter {
@Value("${endpoints.cors.allowed-origins}")
private String allowedOrigins;
@Value("${endpoints.cors.allow-credentials}")
private boolean allowCredentials;
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/**")
.allowedOrigins(allowedOrigins)
.allowCredentials(allowCredentials);
}
}
を次のように私はJava設定を追加するまで、それが適用されなかった、なぜYMLの設定は適用されませんか?