Skip to content

Commit c8d61b6

Browse files
committed
deps: etag@~1.7.0
fixes expressjs#2667
1 parent 0fbf207 commit c8d61b6

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

History.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
- perf: deduce the scope of try-catch deopt
2727
- perf: remove argument reassignments
2828
29+
* deps: etag@~1.7.0
30+
- Always include entity length in ETags for hash length extensions
31+
- Generate non-Stats ETags using MD5 only (no longer CRC32)
32+
- Improve stat performance by removing hashing
33+
- Improve support for JXcore
34+
- Remove base64 padding in ETags to shorten
35+
- Support "fake" stats objects in environments without fs
36+
- Use MD5 instead of MD4 in weak ETags over 1KB
2937
3038
- Work in global strict mode
3139

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"debug": "~2.2.0",
3737
"depd": "~1.0.1",
3838
"escape-html": "1.0.2",
39-
"etag": "~1.5.1",
39+
"etag": "~1.7.0",
4040
"fresh": "0.2.4",
4141
"merge-descriptors": "1.0.0",
4242
"methods": "~1.1.1",

test/res.send.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('res', function(){
121121

122122
request(app)
123123
.get('/')
124-
.expect('ETag', 'W/"fz/jGo0ONwzb+aKy/rWipg=="')
124+
.expect('ETag', 'W/"7ff-fFD7Se+Vsq6deAl063thow"')
125125
.expect(200, done);
126126
})
127127

@@ -193,7 +193,7 @@ describe('res', function(){
193193

194194
request(app)
195195
.get('/')
196-
.expect('ETag', 'W/"fz/jGo0ONwzb+aKy/rWipg=="')
196+
.expect('ETag', 'W/"7ff-fFD7Se+Vsq6deAl063thow"')
197197
.expect(200, done);
198198
})
199199

@@ -309,7 +309,7 @@ describe('res', function(){
309309

310310
request(app)
311311
.get('/')
312-
.set('If-None-Match', 'W/"fz/jGo0ONwzb+aKy/rWipg=="')
312+
.set('If-None-Match', 'W/"7ff-fFD7Se+Vsq6deAl063thow"')
313313
.expect(304, done);
314314
})
315315

@@ -355,7 +355,7 @@ describe('res', function(){
355355

356356
request(app)
357357
.get('/')
358-
.expect('ETag', 'W/"c-5aee35d8"')
358+
.expect('ETag', 'W/"c-ZUfd0NJ26qwjlKF4r8qb2g"')
359359
.expect(200, done);
360360
});
361361

@@ -371,7 +371,7 @@ describe('res', function(){
371371

372372
request(app)
373373
[method]('/')
374-
.expect('ETag', 'W/"c-5aee35d8"')
374+
.expect('ETag', 'W/"c-ZUfd0NJ26qwjlKF4r8qb2g"')
375375
.expect(200, done);
376376
})
377377
});
@@ -387,7 +387,7 @@ describe('res', function(){
387387

388388
request(app)
389389
.get('/')
390-
.expect('ETag', 'W/"0-0"')
390+
.expect('ETag', 'W/"0-1B2M2Y8AsgTpgAmY7PhCfg"')
391391
.expect(200, done);
392392
})
393393

@@ -403,7 +403,7 @@ describe('res', function(){
403403

404404
request(app)
405405
.get('/')
406-
.expect('ETag', 'W/"fz/jGo0ONwzb+aKy/rWipg=="')
406+
.expect('ETag', 'W/"7ff-fFD7Se+Vsq6deAl063thow"')
407407
.expect(200, done);
408408
});
409409

@@ -485,7 +485,7 @@ describe('res', function(){
485485

486486
request(app)
487487
.get('/')
488-
.expect('ETag', '"Otu60XkfuuPskIiUxJY4cA=="')
488+
.expect('ETag', '"d-Otu60XkfuuPskIiUxJY4cA"')
489489
.expect(200, done);
490490
})
491491
})
@@ -502,7 +502,7 @@ describe('res', function(){
502502

503503
request(app)
504504
.get('/')
505-
.expect('ETag', 'W/"d-58988d13"')
505+
.expect('ETag', 'W/"d-Otu60XkfuuPskIiUxJY4cA"')
506506
.expect(200, done)
507507
})
508508
})

test/utils.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,46 @@ var utils = require('../lib/utils')
55
describe('utils.etag(body, encoding)', function(){
66
it('should support strings', function(){
77
utils.etag('express!')
8-
.should.eql('"zZdv4imtWD49AHEviejT6A=="')
8+
.should.eql('"8-zZdv4imtWD49AHEviejT6A"')
99
})
1010

1111
it('should support utf8 strings', function(){
1212
utils.etag('express❤', 'utf8')
13-
.should.eql('"fsFba4IxwQS6h6Umb+FNxw=="')
13+
.should.eql('"a-fsFba4IxwQS6h6Umb+FNxw"')
1414
})
1515

1616
it('should support buffer', function(){
1717
var buf = new Buffer('express!')
1818
utils.etag(buf)
19-
.should.eql('"zZdv4imtWD49AHEviejT6A=="');
19+
.should.eql('"8-zZdv4imtWD49AHEviejT6A"');
2020
})
2121

2222
it('should support empty string', function(){
2323
utils.etag('')
24-
.should.eql('"1B2M2Y8AsgTpgAmY7PhCfg=="');
24+
.should.eql('"0-1B2M2Y8AsgTpgAmY7PhCfg"');
2525
})
2626
})
2727

2828
describe('utils.wetag(body, encoding)', function(){
2929
it('should support strings', function(){
3030
utils.wetag('express!')
31-
.should.eql('W/"8-b8aabac7"')
31+
.should.eql('W/"8-zZdv4imtWD49AHEviejT6A"')
3232
})
3333

3434
it('should support utf8 strings', function(){
3535
utils.wetag('express❤', 'utf8')
36-
.should.eql('W/"a-686b0af1"')
36+
.should.eql('W/"a-fsFba4IxwQS6h6Umb+FNxw"')
3737
})
3838

3939
it('should support buffer', function(){
4040
var buf = new Buffer('express!')
4141
utils.wetag(buf)
42-
.should.eql('W/"8-b8aabac7"');
42+
.should.eql('W/"8-zZdv4imtWD49AHEviejT6A"');
4343
})
4444

4545
it('should support empty string', function(){
4646
utils.wetag('')
47-
.should.eql('W/"0-0"');
47+
.should.eql('W/"0-1B2M2Y8AsgTpgAmY7PhCfg"');
4848
})
4949
})
5050

0 commit comments

Comments
 (0)