为什么在Stripe特权中出现有关标头和授权的错误?

时间:2019-02-16 22:46:53

标签: node.js express heroku stripe-payments

条带化HTTP请求依赖关系返回有关标头的错误,但这些标头不可配置。

使用GET请求看起来不错,但是发布路由失败,并显示以下错误:错误[err_invalid_char]:标头内容[“授权”]中的无效字符

app.post('/charge',function(req,res){

  stripe.charges.create({
      amount: 10,
      description: 'Charge',
      currency: 'gbp',
      customer: 'cus_EXgisfTr7LuiO9'
  },function(err,result){
    if(err){
      res.status(400);
      res.send(err);
    }
    else{
      res.status(201);
      res.send(result);
    }
  });
});

使用HTTP POST请求命中端点https://myapp.herokuapp.com/charge会将其返回到控制台:错误[err_invalid_char]:标头内容[“授权”]中的无效字符

这是Stripe依赖项,开发人员未配置。

0 个答案:

没有答案