Node.js Express中的CORS适用于Safari,但不适用于Chrome

Node.js Express中的CORS适用于Safari,但不适用于Chrome,node.js,reactjs,express,cors,Node.js,Reactjs,Express,Cors,我有一个运行在AWS ElasticBeanstalk上的Express应用程序,通过在我的入口点执行以下操作启用了CORS: app.use(cors()); 我可以使用Postman或Safari上的React应用程序向我的服务器中的端点发出一个简单的POST请求,以便登录。不幸的是,我不能在谷歌浏览器上做这件事。这是我在控制台上看到的: OPTIONS http://**.eu-central-1.elasticbeanstalk.com/signin 0 () 在开发人员工具的“网络

我有一个运行在AWS ElasticBeanstalk上的
Express
应用程序,通过在我的入口点执行以下操作启用了CORS:

app.use(cors());
我可以使用Postman或Safari上的React应用程序向我的服务器中的端点发出一个简单的
POST
请求,以便登录。不幸的是,我不能在谷歌浏览器上做这件事。这是我在控制台上看到的:

OPTIONS http://**.eu-central-1.elasticbeanstalk.com/signin 0 ()
在开发人员工具的“网络”选项卡上,我有以下内容:

我在React中执行API请求,如下所示:

const customHeader = () => ({
  'Content-Type': 'application/json',
  'Access-Control-Allow-Origin':'*',
  Accept: 'application/json',
  Authorization: 'Bearer ' + localStorage.getItem('id_token') || undefined,
});

const base = (method, url, data = {}) => {
  return fetch(`${jwtConfig.fetchUrl}${url}`, {
    method,
    headers: customHeader(),
    body: JSON.stringify(data),
  })
    .then(response => response.json())
    .then(res => res)
    .catch(error => ({ error: 'Server Error' }));
};

const SuperFetch = {};
['get', 'post', 'put', 'delete'].forEach(method => {
  SuperFetch[method] = base.bind(null, method);
});
export default SuperFetch;
并致电:

await SuperFetch.post('signin', userInfo)
事实上,它正在邮递员和Safari上工作,这让我相信它与谷歌Chrome有关。我也已启用,但无法解决问题。

同时添加此标志:

Access-Control-Allow-Headers: Content-Type,Authorization