2012-02-19 00:01:35 +01:00
|
|
|
var common = require('../common');
|
2012-02-14 21:38:24 +01:00
|
|
|
var assert = require('assert');
|
2012-02-19 00:01:35 +01:00
|
|
|
var http = require('http');
|
2012-02-14 21:38:24 +01:00
|
|
|
|
2012-02-19 00:01:35 +01:00
|
|
|
var testResBody = 'other stuff!\n';
|
2012-02-14 21:38:24 +01:00
|
|
|
|
|
|
|
var server = http.createServer(function(req, res) {
|
2012-02-19 00:01:35 +01:00
|
|
|
assert.ok(! ('date' in req.headers),
|
|
|
|
'Request headers contained a Date.');
|
2012-02-14 21:38:24 +01:00
|
|
|
res.writeHead(200, {
|
2012-02-19 00:01:35 +01:00
|
|
|
'Content-Type': 'text/plain'
|
2012-02-14 21:38:24 +01:00
|
|
|
});
|
|
|
|
res.end(testResBody);
|
|
|
|
});
|
|
|
|
server.listen(common.PORT);
|
|
|
|
|
|
|
|
|
2012-02-19 00:01:35 +01:00
|
|
|
server.addListener('listening', function() {
|
2012-02-14 21:38:24 +01:00
|
|
|
var options = {
|
|
|
|
port: common.PORT,
|
2012-02-19 00:01:35 +01:00
|
|
|
path: '/',
|
|
|
|
method: 'GET'
|
|
|
|
};
|
|
|
|
var req = http.request(options, function(res) {
|
|
|
|
assert.ok('date' in res.headers,
|
|
|
|
'Response headers didn\'t contain a Date.');
|
|
|
|
res.addListener('end', function() {
|
2012-02-14 21:38:24 +01:00
|
|
|
server.close();
|
|
|
|
process.exit();
|
|
|
|
});
|
2012-12-13 16:47:33 +01:00
|
|
|
res.resume();
|
2012-02-14 21:38:24 +01:00
|
|
|
});
|
|
|
|
req.end();
|
|
|
|
});
|