Skip to content

Commit

Permalink
already passing range test
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Dec 1, 2014
1 parent 0f3a6d0 commit 6a91e72
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/range.js
@@ -0,0 +1,23 @@
var test = require('tap').test,
ecstatic = require('../'),
http = require('http'),
request = require('request');

test('range', function (t) {
t.plan(3);
var server = http.createServer(ecstatic(__dirname + '/public/subdir'));
t.on('end', function () { server.close() })

server.listen(0, function () {
var port = server.address().port;
var opts = {
uri: 'http://localhost:' + port + '/e.html',
headers: { range: '3-5' }
};
request.get(opts, function (err, res, body) {
t.ifError(err);
t.equal(res.statusCode, 206, 'partial content status code');
t.equal(body, 'e!!');
});
});
});

0 comments on commit 6a91e72

Please sign in to comment.