Skip to content
Myr

deps: etag@~1.7.0

Before adoption: this commit came in with the history the project adopted, so no landing records it.

fixes #2667

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 0fbf207 · Browse files · 4 files+26 added−18 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+26 added−18 removed

  • tests:+17 added−17 removed
  • other:+9 added−1 removed

4 files+26 added−18 removed

modified:test/res.send.js+9 added-9 removed
119 unmodified lines
120 });121122 request(app)123 .get('/')124 .expect('ETag', 'W/"fz/jGo0ONwzb+aKy/rWipg=="')124 .expect('ETag', 'W/"7ff-fFD7Se+Vsq6deAl063thow"')125 .expect(200, done);126 })127128 it('should not override Content-Type', function(done){
63 unmodified lines
192 });193194 request(app)195 .get('/')196 .expect('ETag', 'W/"fz/jGo0ONwzb+aKy/rWipg=="')196 .expect('ETag', 'W/"7ff-fFD7Se+Vsq6deAl063thow"')197 .expect(200, done);198 })199200 it('should not override Content-Type', function(done){
107 unmodified lines
308 });309310 request(app)311 .get('/')312 .set('If-None-Match', 'W/"fz/jGo0ONwzb+aKy/rWipg=="')312 .set('If-None-Match', 'W/"7ff-fFD7Se+Vsq6deAl063thow"')313 .expect(304, done);314 })315316 it('should not perform freshness check unless 2xx or 304', function(done){
37 unmodified lines
354 app.enable('etag');355356 request(app)357 .get('/')358 .expect('ETag', 'W/"c-5aee35d8"')358 .expect('ETag', 'W/"c-ZUfd0NJ26qwjlKF4r8qb2g"')359 .expect(200, done);360 });361362 methods.forEach(function (method) {
7 unmodified lines
370 });371372 request(app)373 [method]('/')374 .expect('ETag', 'W/"c-5aee35d8"')374 .expect('ETag', 'W/"c-ZUfd0NJ26qwjlKF4r8qb2g"')375 .expect(200, done);376 })377 });378
7 unmodified lines
386 app.enable('etag');387388 request(app)389 .get('/')390 .expect('ETag', 'W/"0-0"')390 .expect('ETag', 'W/"0-1B2M2Y8AsgTpgAmY7PhCfg"')391 .expect(200, done);392 })393394 it('should send ETag for long response', function (done) {
7 unmodified lines
402 app.enable('etag');403404 request(app)405 .get('/')406 .expect('ETag', 'W/"fz/jGo0ONwzb+aKy/rWipg=="')406 .expect('ETag', 'W/"7ff-fFD7Se+Vsq6deAl063thow"')407 .expect(200, done);408 });409410 it('should not override ETag when manually set', function (done) {
73 unmodified lines
484 });485486 request(app)487 .get('/')488 .expect('ETag', '"Otu60XkfuuPskIiUxJY4cA=="')488 .expect('ETag', '"d-Otu60XkfuuPskIiUxJY4cA"')489 .expect(200, done);490 })491 })492
8 unmodified lines
501 });502503 request(app)504 .get('/')505 .expect('ETag', 'W/"d-58988d13"')505 .expect('ETag', 'W/"d-Otu60XkfuuPskIiUxJY4cA"')506 .expect(200, done)507 })508 })509
45 unmodified lines
modified:test/utils.js+8 added-8 removed
3 unmodified lines
45describe('utils.etag(body, encoding)', function(){6 it('should support strings', function(){7 utils.etag('express!')8 .should.eql('"zZdv4imtWD49AHEviejT6A=="')8 .should.eql('"8-zZdv4imtWD49AHEviejT6A"')9 })1011 it('should support utf8 strings', function(){12 utils.etag('express❤', 'utf8')13 .should.eql('"fsFba4IxwQS6h6Umb+FNxw=="')13 .should.eql('"a-fsFba4IxwQS6h6Umb+FNxw"')14 })1516 it('should support buffer', function(){17 var buf = new Buffer('express!')18 utils.etag(buf)19 .should.eql('"zZdv4imtWD49AHEviejT6A=="');19 .should.eql('"8-zZdv4imtWD49AHEviejT6A"');20 })2122 it('should support empty string', function(){23 utils.etag('')24 .should.eql('"1B2M2Y8AsgTpgAmY7PhCfg=="');24 .should.eql('"0-1B2M2Y8AsgTpgAmY7PhCfg"');25 })26})2728describe('utils.wetag(body, encoding)', function(){29 it('should support strings', function(){30 utils.wetag('express!')31 .should.eql('W/"8-b8aabac7"')31 .should.eql('W/"8-zZdv4imtWD49AHEviejT6A"')32 })3334 it('should support utf8 strings', function(){35 utils.wetag('express❤', 'utf8')36 .should.eql('W/"a-686b0af1"')36 .should.eql('W/"a-fsFba4IxwQS6h6Umb+FNxw"')37 })3839 it('should support buffer', function(){40 var buf = new Buffer('express!')41 utils.wetag(buf)42 .should.eql('W/"8-b8aabac7"');42 .should.eql('W/"8-zZdv4imtWD49AHEviejT6A"');43 })4445 it('should support empty string', function(){46 utils.wetag('')47 .should.eql('W/"0-0"');47 .should.eql('W/"0-1B2M2Y8AsgTpgAmY7PhCfg"');48 })49})5051describe('utils.isAbsolute()', function(){
199 unmodified lines
modified:History.md+8 added
24 unmodified lines
25 * deps: cookie@0.1.326 - perf: deduce the scope of try-catch deopt27 - perf: remove argument reassignments28 * deps: escape-html@1.0.229 * deps: etag@~1.7.030 - Always include entity length in ETags for hash length extensions31 - Generate non-Stats ETags using MD5 only (no longer CRC32)32 - Improve stat performance by removing hashing33 - Improve support for JXcore34 - Remove base64 padding in ETags to shorten35 - Support "fake" stats objects in environments without fs36 - Use MD5 instead of MD4 in weak ETags over 1KB37 * deps: mkdirp@0.5.138 - Work in global strict mode39403.20.3 / 2015-05-17
2054 unmodified lines
modified:package.json+1 added-1 removed