📜  spring boot put invalid cors request - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:05.489000             🧑  作者: Mango

代码示例1
@Override
public void addCorsMappings(CorsRegistry registry) {
    registry.addMapping("/api/**")
        .allowedOrigins("http://domain2.com")
        .allowedMethods("PUT", "DELETE")
            .allowedHeaders("header1", "header2", "header3")
        .exposedHeaders("header1", "header2")
        .allowCredentials(false).maxAge(3600);
}Copied