📜  spring web mvc 中 https 的 cors 标头 - Java 代码示例

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

代码示例1
@Override
            public void addCorsMappings(CorsRegistry registry) {
                registry.addMapping("/**").allowedOrigins("*")
                        .allowedMethods("GET", "PUT", "POST", "PATCH", "DELETE", "OPTIONS")
                        .allowedHeaders("Content-Type", "api_key", "Authorization", "X-Requested-With");
            }