Skip to content
Myr

fix etag quoting. Closes #1310

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

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent f2f0976 · Browse files · 2 files+5 added−5 removed
This commit

State

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

Diff stats

2 files+5 added−5 removed

  • tests:+3 added−3 removed
  • other:+2 added−2 removed

2 files+5 added−5 removed

modified:lib/utils.js+2 added-2 removed
13 unmodified lines
14 * @api private15 */1617exports.etag = function(body){18 return Buffer.isBuffer(body)18 return '"' + (Buffer.isBuffer(body)19 ? crc.buffer.crc32(body)20 : crc.crc32(body);20 : crc.crc32(body)) + '"';21};2223/**24 * Make `locals()` bound to the given `obj`.
260 unmodified lines
modified:test/res.send.js+3 added-3 removed
102 unmodified lines
103 });104105 request(app)106 .get('/')107 .expect('ETag', '-1498647312')107 .expect('ETag', '"-1498647312"')108 .end(done);109 })110 111 it('should not override Content-Type', function(done){
74 unmodified lines
186 });187188 request(app)189 .get('/')190 .expect('ETag', '-1498647312')190 .expect('ETag', '"-1498647312"')191 .end(done);192 })193194 it('should not override Content-Type', function(done){
107 unmodified lines
302 });303304 request(app)305 .get('/')306 .set('If-None-Match', '-1498647312')306 .set('If-None-Match', '"-1498647312"')307 .expect(304, done);308 })309310 it('should not perform freshness check unless 2xx or 304', function(done){
15 unmodified lines