Skip to content

Commit

Permalink
Added a test to ensure that etags do no mess up far future headers
Browse files Browse the repository at this point in the history
  • Loading branch information
3rd-Eden committed Oct 10, 2011
1 parent 59e4c3b commit 07b84f4
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/static.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,5 +519,27 @@ module.exports = {
io.server.close();
done();
});
}
},

'test that etags are ignored for versioned requests': function (done) {
var port = ++ports
, io = sio.listen(port)
, cl = client(port);

io.enable('browser client etag');

cl.get('/socket.io/socket.io.v0.8.9.js', function (res, data) {
should.strictEqual(res.headers.etag, undefined);
res.headers['content-type'].should.eql('application/javascript');
res.headers['content-length'].should.match(/([0-9]+)/);
res.headers['cache-control']
.indexOf(io.get('browser client expires')).should.be.above(-1);

data.should.match(/XMLHttpRequest/);

cl.end();
io.server.close();
done();
});
},
};

0 comments on commit 07b84f4

Please sign in to comment.