//允许所有地址
response.setHeader("Access-Control-Allow-Origin", "*");
//允许的方法
response.setHeader("Access-Control-Allow-Methods", "POST, GET,PUT, OPTIONS, DELETE,OPTIONS");
//所能看到的请求头
response.setHeader("Access-Control-Allow-Headers","Authorization,Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With");
//浏览器所能获取到的请求头
response.setHeader("Access-Control-Expose-Headers","Authorization,Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With");
|