AngularJS not detecting Access-Control-Allow-Origin header?

后端 未结 9 1268
眼角桃花
眼角桃花 2020-11-28 11:20

I am running an angular app on a local virtualhost (http://foo.app:8000). It is making a request to another local VirtualHost (http://bar.app:8000) using $http.post

9条回答
  •  盖世英雄少女心
    2020-11-28 11:21

    If you guys are having this problem in sails.js just set your cors.js to include Authorization as the allowed header

    /***************************************************************************
      *                                                                          *
      * Which headers should be allowed for CORS requests? This is only used in  *
      * response to preflight requests.                                          *
      *                                                                          *
      ***************************************************************************/
    
      headers: 'Authorization' // this line here

提交回复
热议问题