为什么在获取请求后,远程服务器响应在nodejs上不包含x-csrf-token?

我正在使用nodejs和请求插件( https://github.com/request/request )来创build代理。 路由一切正常,但我的代理服务器应该转发的其中一个服务器需要CSRF令牌。 问题是,正在发送提取请求,但服务器响应不包含x-csrf-token。 这似乎是请求插件是“swalling”这个字段。 我的意思是,这不是空的回应,不。 标题甚至不包含该字段。

我必须使用请求插件的原因。 所以切换插件是没有帮助的。 任何想法可以导致这个问题?

更新(示例代码)

app.use(sIncoming, function (req, res, next) { options = { 'url': sDestination + req.url, 'ca': cas, 'jar': true,// enable cookies, 'strictSSL': true, 'headers': { accept: '*/*' } }; request(options, function (err, response, body) { if (err) onsole.error(err); else { if (typeof req.headers['x-csrf-token'] === "string") { console.log("#1 " + (typeof req.headers['x-csrf-token'])); // string console.log("#2 " + (req.headers['x-csrf-token'])); // fetch console.log("#3 " + (typeof response.headers['x-csrf-token'])); //undefined } }).pipe(res); 

  req.pipe(request(options, function (err, response, body) { if (err) { return console.error('upload failed:', err); } }), {end: (req.method === "GET" ? true : false)}).pipe(res); 

做到了