Request header field * is not allowed by Access-Control-Allow-Headers in preflight response
程序员文章站
2022-07-14 23:48:47
...
跨域问题记录:请求 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';
上一篇: JAVA String.format