Instagram 不允许用于需要飞行前的跨来源请求

Instagram 不允许用于需要飞行前的跨来源请求,instagram,sails.js,Instagram,Sails.js,使用Instagram auth API时出错。 上面是我的cors.js,在其中我允许所有请求,但它不起作用。请告诉我你是否已经做过这类工作 module.exports.cors = { allRoutes: true, origin: '*', credentials: true, methods: 'GET, POST, PUT, DELETE, OPTIONS, HEAD', headers: 'X-Requested-Wi

使用Instagram auth API时出错。 上面是我的cors.js,在其中我允许所有请求,但它不起作用。请告诉我你是否已经做过这类工作

     module.exports.cors = {

    allRoutes: true,


    origin: '*',

    credentials: true,

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

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

此客户端脚本是否与instagram API连接?那么它与sails无关。不,这是服务器端脚本,使用sails js编写。那么服务器上会生成错误吗?因为它看起来像是在浏览器中生成的。看起来您的客户端正在向您的服务器发送请求,而您的服务器正在将该请求重定向到instagram,而浏览器不喜欢这样。
  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.