Heroku无耻地将标题字段“ Connection:Keep-Alive”更改为“ close”

时间:2018-12-13 19:23:48

标签: node.js heroku

当我发布请求时,我显式设置了标题字段Connection: Keep-Alive

 const res = await fetch("/enddev", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Connection: "Keep-Alive"
      },
      body: '{"id": "FFAABBCC"}'
    });

在Node.js服务器上,我打印出请求标头以进行调试:

app.post("/enddev", (req, res) => {
  console.log("REQUEST TO ", req.route.path);
  console.log("Req Header ", req.headers);
  socket = res.socket;
  res.send("request\r\n");
});

这是根据要求提供的Heroku控制台:

enter image description here

0 个答案:

没有答案