Request header field * is not allowed by Access-Control-Allow-Headers in preflight response

跨域问题记录:请求 headers里添加自定义header时,出现以下错误



错误原因   


参考:https://www.cnblogs.com/cc299/p/7339583.html

解决方法如下

nginx  配置 add_header 'Access-Control-Allow-Headers' 添加 自定义header 

add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,access_token';

发布了48 篇原创文章 · 获赞 34 · 访问量 18万+

猜你喜欢

转载自blog.csdn.net/u014481096/article/details/79792583