6
我希望我的服務器允許我的移動應用程序的'授權'標頭。目前我的網絡服務器在帆,我用帆。我的路線代碼是如何在CORS允許航行標頭
'post /auth/local' : {
cors: {
origin: '*'
},
controller: 'AuthController',
action: 'callback'
},
當我的客戶端頭將與「授權」的要求,我得到錯誤
XMLHttpRequest cannot load http://localhost:1337/auth/local.
Request header field Authorization is not allowed by Access-Control-Allow-Headers.
是「授權」報頭,也允許我怎麼在我的路線代碼中指定?
我該如何對所有路線一次做到這一點? – raju
使用'cors:true'和[config.cors.js](http://sailsjs.org/documentation/reference/configuration/sails-config-cors),setup [here](http://sailsjs.org/文檔/概念/安全/ CORS).Regards。 –