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

跨域问题
报错信息为:Failed to load http://192.168.30.119: Request header field language is not allowed by Access-Control-Allow-Headers in preflight response.

原因:前台发送的请求体包含了没有允许的Header

如何解决问题:在请求体加入允许的Header类型

原有代码: response.setHeader(“Access-Control-Allow-Headers”, “x-requested-with,Authorization”);
修改后: response.setHeader(“Access-Control-Allow-Headers”, "x-requested-with,Authorization,language");

上一篇:Android Studio 出现 attribute android:layout_width is not allowed here等问题


下一篇:ubuntu下安装ftp服务