CORS policy: Request header field passstatic is not allowed by Access-Control-Allow-Headers in preflight response

 

1,在springboot项目中,加入了注解,

@CrossOrigin,

无用,

 

2,之后添加nginx配置,

add_header Access-Control-Allow-Origin *;
ccess-Control-Allow-Headers "Authorization, Origin, X-Requested-With, Content-Type, Accept";
add_header Access-Control-Allow-Methods GET,POST,PUT,OPTIONS;

无用
3,最后修改成

add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Allow-Methods GET,POST,PUT,OPTIONS;

 

OK

posted on 2020-10-27 17:27  woshare  阅读(425)  评论(0编辑  收藏  举报