Skip to content

Commit 968e94e

Browse files
committed
Merge pull request socketio#1655 from ysmood/fix_etag_header
We should use the standard http protocol to handler the etag header
2 parents c18ed5f + 8c19eef commit 968e94e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,9 @@ Server.prototype.attachServe = function(srv){
269269
*/
270270

271271
Server.prototype.serve = function(req, res){
272-
if (req.headers.etag) {
273-
if (clientVersion == req.headers.etag) {
272+
var etag = req.headers['if-none-match'];
273+
if (etag) {
274+
if (clientVersion == etag) {
274275
debug('serve client 304');
275276
res.writeHead(304);
276277
res.end();

test/socket.io.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ describe('socket.io', function(){
161161
io(srv);
162162
request(srv)
163163
.get('/socket.io/socket.io.js')
164-
.set('ETag', clientVersion)
164+
.set('If-None-Match', clientVersion)
165165
.end(function(err, res){
166166
if (err) return done(err);
167167
expect(res.statusCode).to.be(304);

0 commit comments

Comments
 (0)