Access-Control-Allow-Origin and Angular.js $http

前端 未结 7 1827
盖世英雄少女心
盖世英雄少女心 2020-12-24 06:37

Whenever I make a webapp and I get a CORS problem, I start making coffee. After screwing with it for a while I manage to get it working but this time it\'s not and I need he

7条回答
  •  借酒劲吻你
    2020-12-24 06:56

    I've had success with express and editing the res.header. Mine matches yours pretty closely but I have a different Allow-Headers as noted below:

    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    

    I'm also using Angular and Node/Express, but I don't have the headers called out in the Angular code only the node/express

提交回复
热议问题