不允许需要预检的跨源请求

时间:2014-10-28 18:34:55

标签: instagram sails.js

     module.exports.cors = {

    allRoutes: true,


    origin: '*',

    credentials: true,

    methods: 'GET, POST, PUT, DELETE, OPTIONS, HEAD',

    headers: 'X-Requested-With,content-type'
};

使用Instagram auth API时出错。 上面是我的“cors.js”我允许所有请求,但它没有用。请告诉我你是否已经完成了这类工作。

  XMLHttpRequest cannot load http://localhost:1337/api/v1/instagram/auth. The request was redirected to 'https://api.instagram.com/oauth/authorize?client_id=5238d8f3c0284df3a5d724f…2Fv1%2Finstagram%2Fcallback&response_type=code&state=a%20state&scope=likes', which is disallowed for cross-origin requests that require preflight. 

0 个答案:

没有答案