Skip to content

Commit

Permalink
fix: We should use the standard http protocol to handler the etag
Browse files Browse the repository at this point in the history
header.
  • Loading branch information
ysmood committed Jun 29, 2014
1 parent 662b306 commit 8c19eef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/index.js
Expand Up @@ -265,8 +265,9 @@ Server.prototype.attachServe = function(srv){
*/

Server.prototype.serve = function(req, res){
if (req.headers.etag) {
if (clientVersion == req.headers.etag) {
var etag = req.headers['if-none-match'];
if (etag) {
if (clientVersion == etag) {
debug('serve client 304');
res.writeHead(304);
res.end();
Expand Down
2 changes: 1 addition & 1 deletion test/socket.io.js
Expand Up @@ -161,7 +161,7 @@ describe('socket.io', function(){
io(srv);
request(srv)
.get('/socket.io/socket.io.js')
.set('ETag', clientVersion)
.set('If-None-Match', clientVersion)
.end(function(err, res){
if (err) return done(err);
expect(res.statusCode).to.be(304);
Expand Down

0 comments on commit 8c19eef

Please sign in to comment.