mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
568 B
22 lines
568 B
process.mixin(require("./common"));
|
|
var http = require("http");
|
|
var PORT = 8888;
|
|
|
|
var UTF8_STRING = "Il était tué";
|
|
|
|
var server = http.createServer(function(req, res) {
|
|
res.sendHeader(200, {"Content-Type": "text/plain; charset=utf8"});
|
|
res.write(UTF8_STRING, 'utf8');
|
|
res.close();
|
|
});
|
|
server.listen(PORT);
|
|
|
|
http.cat("http://localhost:"+PORT+"/", "utf8")
|
|
.addCallback(function (data) {
|
|
assert.equal(UTF8_STRING, data);
|
|
server.close();
|
|
})
|
|
.addErrback(function() {
|
|
assert.ok(false, 'http.cat should succeed in < 1000ms');
|
|
})
|
|
.timeout(1000);
|
|
|