nodejs-http.createServer, кажется, звонит дважды
Если я пишу следующую программу в узле:
http.createServer(function (req, res) {
if( req.method == 'GET' ) {
var body = ''; req.on('data', function(data) { body += data });
req.on('end', function() {
console.log('request ended')
});
}
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('142n');
}).listen(3500);
а затем нажмите на сервер с http://xxx.xx.xxx.xx:35010
Я вижу request ended
дважды на моей консоли -- я не уверен, почему один HTTP-запрос вызывает это выполнение дважды.