2010-02-25 07:36:17 +01:00
|
|
|
process.mixin(require("../common"));
|
2009-11-11 18:32:00 +01:00
|
|
|
var http = require("http");
|
|
|
|
|
|
|
|
var UTF8_STRING = "Il était tué";
|
|
|
|
|
|
|
|
var server = http.createServer(function(req, res) {
|
2010-02-25 21:54:48 +01:00
|
|
|
res.writeHead(200, {"Content-Type": "text/plain; charset=utf8"});
|
2010-02-17 07:16:29 +01:00
|
|
|
res.write(UTF8_STRING, 'utf8');
|
2010-02-17 20:10:10 +01:00
|
|
|
res.close();
|
2009-11-11 18:32:00 +01:00
|
|
|
});
|
|
|
|
server.listen(PORT);
|
|
|
|
|
2010-02-20 01:26:48 +01:00
|
|
|
http.cat("http://localhost:"+PORT+"/", "utf8", function (err, data) {
|
|
|
|
if (err) throw err;
|
|
|
|
assert.equal(UTF8_STRING, data);
|
|
|
|
server.close();
|
|
|
|
})
|