可以将新行添加到节点js中的http标头中

时间:2014-04-06 14:44:31

标签: javascript node.js

我可以在第5行的这个例子中添加“\ n”吗? 如果我能,hahaha会出现在http响应体中吗?

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {
  'Content-Length': body.length,
  'Location' : 'http://www.aaa.com\nhahaha',
  'Content-Type': 'text/plain' });
  res.end('Hello World\n');
}).listen(1337, "127.0.0.1");

感谢您的帮助

1 个答案:

答案 0 :(得分:-1)

节点将过滤\ n

因此,使用此代码将无法注入..