Skip to content
Myr

Merge tag '4.12.0'

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

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parents a9ef9e1, 51f960f · Browse files · 18 files+411 added−202 removed
This commit

State

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

Diff stats

18 files+411 added−202 removed

  • tests:+241 added−150 removed
  • other:+170 added−52 removed

18 files+411 added−202 removed

modified:examples/mvc/controllers/pet/views/edit.ejs+1 added-1 removed
6 unmodified lines
78<body>9<h1><%= pet.name %></h1>10<form action="/pet/<%= pet.id %>?_method=put" method="post">11 <label>Name: <input type="text" name="user[name]" value="<%= pet.name %>"></label>11 <label>Name: <input type="text" name="pet[name]" value="<%= pet.name %>"></label>12 <input type="submit" value="Update">13</form>14</body>15</html>
modified:examples/mvc/lib/boot.js+1 added-1 removed
modified:lib/application.js+38 added-2 removed
1/*!2 * express3 * Copyright(c) 2009-2013 TJ Holowaychuk4 * Copyright(c) 2013 Roman Shtylman5 * Copyright(c) 2014-2015 Douglas Christopher Wilson6 * MIT Licensed7 */89/**10 * Module dependencies.11 * @api private12 */1314var finalhandler = require('finalhandler');15var flatten = require('./utils').flatten;
15 unmodified lines
3132var app = exports = module.exports = {};3334/**35 * Variable for trust proxy inheritance back-compat36 * @api private37 */3839var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default';4041/**42 * Initialize the server.43 *44 * - setup default configuration45 * - setup default middleware
42 unmodified lines
88 this.set('query parser', 'extended');89 this.set('subdomain offset', 2);90 this.set('trust proxy', false);9192 // trust proxy inherit back-compat93 Object.defineProperty(this.settings, trustProxyDefaultSymbol, {94 configurable: true,95 value: true96 });9798 debug('booting in %s mode', env);9978 // inherit protos79 this.on('mount', function(parent){100 this.on('mount', function onmount(parent) {101 // inherit trust proxy102 if (this.settings[trustProxyDefaultSymbol] === true103 && typeof parent.settings['trust proxy fn'] === 'function') {104 delete this.settings['trust proxy'];105 delete this.settings['trust proxy fn'];106 }107108 // inherit protos109 this.request.__proto__ = parent.request;110 this.response.__proto__ = parent.response;111 this.engines.__proto__ = parent.engines;112 this.settings.__proto__ = parent.settings;
236 unmodified lines
349 break;350 case 'trust proxy':351 debug('compile trust proxy %s', val);352 this.set('trust proxy fn', compileTrust(val));353354 // trust proxy inherit back-compat355 Object.defineProperty(this.settings, trustProxyDefaultSymbol, {356 configurable: true,357 value: false358 });359360 break;361 }362363 return this;
230 unmodified lines
modified:lib/request.js+4 added-4 removed
61 unmodified lines
62 * Check if the given `type(s)` is acceptable, returning63 * the best match when true, otherwise `undefined`, in which64 * case you should respond with 406 "Not Acceptable".65 *66 * The `type` value may be a single mime type string67 * such as "application/json", the extension name68 * such as "json", a comma-delimted list such as "json, html, text/plain",66 * The `type` value may be a single MIME type string67 * such as "application/json", an extension name68 * such as "json", a comma-delimited list such as "json, html, text/plain",69 * an argument list such as `"json", "html", "text/plain"`,70 * or an array `["json", "html", "text/plain"]`. When a list71 * or array is given the _best_ match, if any is returned.71 * or array is given, the _best_ match, if any is returned.72 *73 * Examples:74 *75 * // Accept: text/html
417 unmodified lines
modified:lib/response.js+15 added-10 removed
1/*!2 * express3 * Copyright(c) 2009-2013 TJ Holowaychuk4 * Copyright(c) 2014-2015 Douglas Christopher Wilson5 * MIT Licensed6 */78/**9 * Module dependencies.10 * @api private11 */1213var contentDisposition = require('content-disposition');14var deprecate = require('depd')('express');
133 unmodified lines
148 len = chunk.length;149 this.set('Content-Length', len);150 }151144 // method check145 var isHead = req.method === 'HEAD';146147 // ETag support148 if (len !== undefined && (isHead || req.method === 'GET')) {149 var etag = app.get('etag fn');150 if (etag && !this.get('ETag')) {151 etag = etag(chunk, encoding);152 etag && this.set('ETag', etag);152 // populate ETag153 var etag;154 var generateETag = len !== undefined && app.get('etag fn');155 if (typeof generateETag === 'function' && !this.get('ETag')) {156 if ((etag = generateETag(chunk, encoding))) {157 this.set('ETag', etag);158 }159 }160161 // freshness
6 unmodified lines
168 this.removeHeader('Transfer-Encoding');169 chunk = '';170 }171167 if (isHead) {172 if (req.method === 'HEAD') {173 // skip body for HEAD174 this.end();175 } else {176 // respond
751 unmodified lines
modified:lib/utils.js+15 added-5 removed
1/*!2 * express3 * Copyright(c) 2009-2013 TJ Holowaychuk4 * Copyright(c) 2014-2015 Douglas Christopher Wilson5 * MIT Licensed6 */78/**9 * Module dependencies.10 * @api private11 */1213var mime = require('send').mime;14var contentType = require('content-type');15var etag = require('etag');16var proxyaddr = require('proxy-addr');17var qs = require('qs');18var querystring = require('querystring');10var typer = require('media-typer');1920/**21 * Return strong ETag for `body`.22 *
226 unmodified lines
249 * @return {String}250 * @api private251 */252245exports.setCharset = function(type, charset){246 if (!type || !charset) return type;253exports.setCharset = function setCharset(type, charset) {254 if (!type || !charset) {255 return type;256 }257258 // parse type249 var parsed = typer.parse(type);259 var parsed = contentType.parse(type);260261 // set charset262 parsed.parameters.charset = charset;263264 // format type255 return typer.format(parsed);265 return contentType.format(parsed);266};
modified:test/config.js+74 added-29 removed
12var express = require('../')3 , assert = require('assert');2var assert = require('assert');3var express = require('..');45describe('config', function(){6 describe('.set()', function(){7 it('should set a value', function(){5describe('config', function () {6 describe('.set()', function () {7 it('should set a value', function () {8 var app = express();9 app.set('foo', 'bar').should.equal(app);9 app.set('foo', 'bar');10 assert.equal(app.get('foo'), 'bar');11 })1212 it('should return the app when undefined', function(){13 it('should return the app', function () {14 var app = express();14 app.set('foo', undefined).should.equal(app);15 assert.equal(app.set('foo', 'bar'), app);16 })1718 it('should return the app when undefined', function () {19 var app = express();20 assert.equal(app.set('foo', undefined), app);21 })2223 describe('"etag"', function(){24 it('should throw on bad value', function(){19 var app = express()20 app.set.bind(app, 'etag', 42).should.throw(/unknown value/)25 var app = express();26 assert.throws(app.set.bind(app, 'etag', 42), /unknown value/);27 })2829 it('should set "etag fn"', function(){30 var app = express()31 var fn = function(){}32 app.set('etag', fn)27 app.get('etag fn').should.equal(fn)33 assert.equal(app.get('etag fn'), fn)34 })35 })3637 describe('"trust proxy"', function(){38 it('should set "trust proxy fn"', function(){39 var app = express()40 var fn = function(){}41 app.set('trust proxy', fn)36 app.get('trust proxy fn').should.equal(fn)42 assert.equal(app.get('trust proxy fn'), fn)43 })44 })45 })4647 describe('.get()', function(){48 it('should return undefined when unset', function(){49 var app = express();44 assert(undefined === app.get('foo'));50 assert.strictEqual(app.get('foo'), undefined);51 })52 53 it('should otherwise return the value', function(){54 var app = express();55 app.set('foo', 'bar');50 app.get('foo').should.equal('bar');56 assert.equal(app.get('foo'), 'bar');57 })5859 describe('when mounted', function(){60 it('should default to the parent app', function(){55 var app = express()56 , blog = express();61 var app = express();62 var blog = express();6364 app.set('title', 'Express');65 app.use(blog);60 blog.get('title').should.equal('Express');66 assert.equal(blog.get('title'), 'Express');67 })62 6869 it('should given precedence to the child', function(){64 var app = express()65 , blog = express();70 var app = express();71 var blog = express();7273 app.use(blog);74 app.set('title', 'Express');75 blog.set('title', 'Some Blog');7671 blog.get('title').should.equal('Some Blog');77 assert.equal(blog.get('title'), 'Some Blog');78 })7980 it('should inherit "trust proxy" setting', function () {81 var app = express();82 var blog = express();8384 function fn() { return false }8586 app.set('trust proxy', fn);87 assert.equal(app.get('trust proxy'), fn);88 assert.equal(app.get('trust proxy fn'), fn);8990 app.use(blog);9192 assert.equal(blog.get('trust proxy'), fn);93 assert.equal(blog.get('trust proxy fn'), fn);94 })9596 it('should prefer child "trust proxy" setting', function () {97 var app = express();98 var blog = express();99100 function fn1() { return false }101 function fn2() { return true }102103 app.set('trust proxy', fn1);104 assert.equal(app.get('trust proxy'), fn1);105 assert.equal(app.get('trust proxy fn'), fn1);106107 blog.set('trust proxy', fn2);108 assert.equal(blog.get('trust proxy'), fn2);109 assert.equal(blog.get('trust proxy fn'), fn2);110111 app.use(blog);112113 assert.equal(app.get('trust proxy'), fn1);114 assert.equal(app.get('trust proxy fn'), fn1);115 assert.equal(blog.get('trust proxy'), fn2);116 assert.equal(blog.get('trust proxy fn'), fn2);117 })118 })119 })120121 describe('.enable()', function(){122 it('should set the value to true', function(){123 var app = express();79 app.enable('tobi').should.equal(app);80 app.get('tobi').should.be.true;124 assert.equal(app.enable('tobi'), app);125 assert.strictEqual(app.get('tobi'), true);126 })127 })128 129 describe('.disable()', function(){130 it('should set the value to false', function(){131 var app = express();87 app.disable('tobi').should.equal(app);88 app.get('tobi').should.be.false;132 assert.equal(app.disable('tobi'), app);133 assert.strictEqual(app.get('tobi'), false);134 })135 })136 137 describe('.enabled()', function(){138 it('should default to false', function(){139 var app = express();95 app.enabled('foo').should.be.false;140 assert.strictEqual(app.enabled('foo'), false);141 })142 143 it('should return true when set', function(){144 var app = express();145 app.set('foo', 'bar');101 app.enabled('foo').should.be.true;146 assert.strictEqual(app.enabled('foo'), true);147 })148 })149 150 describe('.disabled()', function(){151 it('should default to true', function(){152 var app = express();108 app.disabled('foo').should.be.true;153 assert.strictEqual(app.disabled('foo'), true);154 })155 156 it('should return false when set', function(){157 var app = express();158 app.set('foo', 'bar');114 app.disabled('foo').should.be.false;159 assert.strictEqual(app.disabled('foo'), false);160 })161 })162})
modified:test/req.ip.js+17 added
modified:test/req.signedCookies.js+1 added-1 removed
27 unmodified lines
28 request(app)29 .get('/')30 .set('Cookie', cookie)31 .end(function(err, res){32 if (err) return don(err);32 if (err) return done(err);33 res.body.should.eql({ obj: { foo: 'bar' } });34 done();35 });36 });
4 unmodified lines
modified:test/res.download.js+26 added-28 removed
12var express = require('../')3 , request = require('supertest')4 , assert = require('assert');2var after = require('after');3var assert = require('assert');4var express = require('..');5var request = require('supertest');67describe('res', function(){8 describe('.download(path)', function(){9 it('should transfer as an attachment', function(done){
28 unmodified lines
38 })3940 describe('.download(path, fn)', function(){41 it('should invoke the callback', function(done){41 var app = express()42 , calls = 0;42 var app = express();43 var cb = after(2, done);4445 app.use(function(req, res){45 res.download('test/fixtures/user.html', done);46 res.download('test/fixtures/user.html', cb);47 });4849 request(app)50 .get('/')51 .expect('Content-Type', 'text/html; charset=UTF-8')52 .expect('Content-Disposition', 'attachment; filename="user.html"')52 .expect(200, function(err){53 assert.ifError(err)54 })53 .expect(200, cb);54 })55 })5657 describe('.download(path, filename, fn)', function(){58 it('should invoke the callback', function(done){60 var app = express()61 , calls = 0;59 var app = express();60 var cb = after(2, done);6162 app.use(function(req, res){63 res.download('test/fixtures/user.html', 'document', done);64 });
1 unmodified line
66 request(app)67 .get('/')68 .expect('Content-Type', 'text/html; charset=UTF-8')69 .expect('Content-Disposition', 'attachment; filename="document"')71 .expect(200, function(err){72 assert.ifError(err)73 })70 .expect(200, cb);71 })72 })7374 describe('on failure', function(){75 it('should invoke the callback', function(done){79 var app = express()80 , calls = 0;76 var app = express();7782 app.use(function(req, res){78 app.use(function (req, res, next) {79 res.download('test/fixtures/foobar.html', function(err){84 assert(404 == err.status);85 assert('ENOENT' == err.code);86 done();80 if (!err) return next(new Error('expected error'));81 res.send('got ' + err.status + ' ' + err.code);82 });83 });8485 request(app)86 .get('/')92 .end(function(){});87 .expect(200, 'got 404 ENOENT', done);88 })8990 it('should remove Content-Disposition', function(done){91 var app = express()92 , calls = 0;9399 app.use(function(req, res){94 app.use(function (req, res, next) {95 res.download('test/fixtures/foobar.html', function(err){96 if (!err) return next(new Error('expected error'));97 res.end('failed');98 });99 });100101 request(app)102 .get('/')107 .expect('failed')108 .end(function(err, res){109 if (err) return done(err);110 res.header.should.not.have.property('content-disposition');111 done();112 });103 .expect(shouldNotHaveHeader('Content-Disposition'))104 .expect(200, 'failed', done);105 })106 })107})108109function shouldNotHaveHeader(header) {110 return function (res) {111 assert.ok(!(header.toLowerCase() in res.headers), 'should not have header ' + header);112 };113}
modified:test/res.send.js+99 added-90 removed
12var express = require('../')3 , request = require('supertest')4 , assert = require('assert');2var assert = require('assert');3var express = require('..');4var methods = require('methods');5var request = require('supertest');67describe('res', function(){8 describe('.send(null)', function(){9 it('should set body to ""', function(done){
89 unmodified lines
99 done();100 })101 })102102 it('should set ETag', function(done){103 it('should set ETag', function (done) {104 var app = express();105105 app.use(function(req, res){106 app.use(function (req, res) {107 var str = Array(1000).join('-');108 res.send(str);109 });110111 request(app)112 .get('/')113 .expect('ETag', 'W/"3e7-8084ccd1"')113 .end(done);114 .expect(200, done);115 })116116 it('should not set ETag for non-GET/HEAD', function(done){117 var app = express();118119 app.use(function(req, res){120 var str = Array(1000).join('-');121 res.send(str);122 });123124 request(app)125 .post('/')126 .end(function(err, res){127 if (err) return done(err);128 assert(!res.header.etag, 'has an ETag');129 done();130 });131 })132117 it('should not override Content-Type', function(done){118 var app = express();119120 app.use(function(req, res){
50 unmodified lines
171 done();172 })173 })174191 it('should set ETag', function(done){175 it('should set ETag', function (done) {176 var app = express();177194 app.use(function(req, res){178 app.use(function (req, res) {179 var str = Array(1000).join('-');180 res.send(new Buffer(str));181 });182183 request(app)184 .get('/')185 .expect('ETag', 'W/"3e7-8084ccd1"')202 .end(done);186 .expect(200, done);187 })188189 it('should not override Content-Type', function(done){190 var app = express();
141 unmodified lines
332 .get('/?callback=foo')333 .expect('{"foo":"bar"}', done);334 })335352 describe('"etag" setting', function(){353 describe('when enabled', function(){354 it('should send ETag', function(done){336 describe('"etag" setting', function () {337 describe('when enabled', function () {338 it('should send ETag', function (done) {339 var app = express();340357 app.use(function(req, res){341 app.use(function (req, res) {342 res.send('kajdslfkasdf');343 });344345 app.enable('etag');346347 request(app)348 .get('/')365 .expect('etag', 'W/"c-5aee35d8"', done)366 })349 .expect('ETag', 'W/"c-5aee35d8"')350 .expect(200, done);351 });352368 it('should send ETag for empty string response', function(done){369 var app = express()353 methods.forEach(function (method) {354 if (method === 'connect') return;355356 it('should send ETag in response to ' + method.toUpperCase() + ' request', function (done) {357 var app = express();358359 app[method]('/', function (req, res) {360 res.send('kajdslfkasdf');361 });362363 request(app)364 [method]('/')365 .expect('ETag', 'W/"c-5aee35d8"')366 .expect(200, done);367 })368 });369370 it('should send ETag for empty string response', function (done) {371 var app = express();372371 app.use(function(req, res){372 res.send('')373 app.use(function (req, res) {374 res.send('');375 });376375 app.enable('etag')377 app.enable('etag');378379 request(app)380 .get('/')379 .expect('etag', 'W/"0-0"', done)381 .expect('ETag', 'W/"0-0"')382 .expect(200, done);383 })384382 it('should send ETag for long response', function(done){385 it('should send ETag for long response', function (done) {386 var app = express();387385 app.use(function(req, res){388 app.use(function (req, res) {389 var str = Array(1000).join('-');390 res.send(str);391 });392393 app.enable('etag');394395 request(app)396 .get('/')394 .expect('etag', 'W/"3e7-8084ccd1"', done)397 .expect('ETag', 'W/"3e7-8084ccd1"')398 .expect(200, done);399 });400397 it('should not override ETag when manually set', function(done){401 it('should not override ETag when manually set', function (done) {402 var app = express();403400 app.use(function(req, res){404 app.use(function (req, res) {405 res.set('etag', '"asdf"');406 res.send('hello!');407 });408409 app.enable('etag');410411 request(app)412 .get('/')409 .expect('etag', '"asdf"', done)413 .expect('ETag', '"asdf"')414 .expect(200, done);415 });416412 it('should not send ETag for res.send()', function(done){413 var app = express()417 it('should not send ETag for res.send()', function (done) {418 var app = express();419415 app.use(function(req, res){416 res.send()420 app.use(function (req, res) {421 res.send();422 });423419 app.enable('etag')424 app.enable('etag');425426 request(app)427 .get('/')423 .end(function(err, res){424 res.headers.should.not.have.property('etag');425 done();426 })428 .expect(shouldNotHaveHeader('ETag'))429 .expect(200, done);430 })431 });432430 describe('when disabled', function(){431 it('should send no ETag', function(done){433 describe('when disabled', function () {434 it('should send no ETag', function (done) {435 var app = express();436434 app.use(function(req, res){437 app.use(function (req, res) {438 var str = Array(1000).join('-');439 res.send(str);440 });441442 app.disable('etag');443444 request(app)445 .get('/')443 .end(function(err, res){444 res.headers.should.not.have.property('etag');445 done();446 });446 .expect(shouldNotHaveHeader('ETag'))447 .expect(200, done);448 });449449 it('should send ETag when manually set', function(done){450 it('should send ETag when manually set', function (done) {451 var app = express();452453 app.disable('etag');454454 app.use(function(req, res){455 app.use(function (req, res) {456 res.set('etag', '"asdf"');457 res.send('hello!');458 });459460 request(app)461 .get('/')461 .expect('etag', '"asdf"', done)462 .expect('ETag', '"asdf"')463 .expect(200, done);464 });465 });466465 describe('when "strong"', function(){466 it('should send strong ETag', function(done){467 var app = express()467 describe('when "strong"', function () {468 it('should send strong ETag', function (done) {469 var app = express();470471 app.set('etag', 'strong');472471 app.use(function(req, res){473 app.use(function (req, res) {474 res.send('hello, world!');475 });476477 request(app)478 .get('/')477 .expect('etag', '"Otu60XkfuuPskIiUxJY4cA=="', done)479 .expect('ETag', '"Otu60XkfuuPskIiUxJY4cA=="')480 .expect(200, done);481 })482 })483481 describe('when "weak"', function(){482 it('should send weak ETag', function(done){483 var app = express()484 describe('when "weak"', function () {485 it('should send weak ETag', function (done) {486 var app = express();487488 app.set('etag', 'weak');489487 app.use(function(req, res){490 app.use(function (req, res) {491 res.send('hello, world!');492 });493494 request(app)495 .get('/')493 .expect('etag', 'W/"d-58988d13"', done)496 .expect('ETag', 'W/"d-58988d13"')497 .expect(200, done)498 })499 })500497 describe('when a function', function(){498 it('should send custom ETag', function(done){499 var app = express()501 describe('when a function', function () {502 it('should send custom ETag', function (done) {503 var app = express();504501 app.set('etag', function(body, encoding){505 app.set('etag', function (body, encoding) {506 var chunk = !Buffer.isBuffer(body)507 ? new Buffer(body, encoding)508 : body;505 chunk.toString().should.equal('hello, world!')506 return '"custom"'509 chunk.toString().should.equal('hello, world!');510 return '"custom"';511 });512509 app.use(function(req, res){513 app.use(function (req, res) {514 res.send('hello, world!');515 });516517 request(app)518 .get('/')515 .expect('etag', '"custom"', done)519 .expect('ETag', '"custom"')520 .expect(200, done);521 })522518 it('should not send falsy ETag', function(done){519 var app = express()523 it('should not send falsy ETag', function (done) {524 var app = express();525521 app.set('etag', function(body, encoding){522 return undefined526 app.set('etag', function (body, encoding) {527 return undefined;528 });529525 app.use(function(req, res){530 app.use(function (req, res) {531 res.send('hello, world!');532 });533534 request(app)535 .get('/')531 .end(function(err, res){532 res.headers.should.not.have.property('etag')533 done();534 })536 .expect(shouldNotHaveHeader('ETag'))537 .expect(200, done);538 })539 })540 })541})542543function shouldNotHaveHeader(header) {544 return function (res) {545 assert.ok(!(header.toLowerCase() in res.headers), 'should not have header ' + header)546 }547}
modified:test/utils.js+24 added-2 removed
12var utils = require('../lib/utils')3 , assert = require('assert');2var assert = require('assert');3var utils = require('../lib/utils');45describe('utils.etag(body, encoding)', function(){6 it('should support strings', function(){7 utils.etag('express!')
16 unmodified lines
24 .should.eql('"1B2M2Y8AsgTpgAmY7PhCfg=="');25 })26})2728describe('utils.setCharset(type, charset)', function () {29 it('should do anything without type', function () {30 assert.strictEqual(utils.setCharset(), undefined);31 });3233 it('should return type if not given charset', function () {34 assert.strictEqual(utils.setCharset('text/html'), 'text/html');35 });3637 it('should keep charset if not given charset', function () {38 assert.strictEqual(utils.setCharset('text/html; charset=utf-8'), 'text/html; charset=utf-8');39 });4041 it('should set charset', function () {42 assert.strictEqual(utils.setCharset('text/html', 'utf-8'), 'text/html; charset=utf-8');43 });4445 it('should override charset', function () {46 assert.strictEqual(utils.setCharset('text/html; charset=iso-8859-1', 'utf-8'), 'text/html; charset=utf-8');47 });48});4950describe('utils.wetag(body, encoding)', function(){51 it('should support strings', function(){52 utils.wetag('express!')53 .should.eql('W/"8-b8aabac7"')
42 unmodified lines
modified:.travis.yml+3 added-6 removed
1language: node_js2node_js:3 - "0.10"4 - "0.11"5matrix:6 allow_failures:7 - node_js: "0.11"8 fast_finish: true9script: "npm run-script test-travis"4 - "0.12"5sudo: false6script: "npm run-script test-ci"7after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"
added:appveyor.yml+13 added
1environment:2 matrix:3 - nodejs_version: "0.10"4 - nodejs_version: "0.12"5install:6 - ps: Install-Product node $env:nodejs_version7 - npm install8build: off9test_script:10 - node --version11 - npm --version12 - npm run test-ci13version: "{build}"
modified:History.md+53 added-1 removed
15.x2===34This incorporates all changes after 4.10.1 up to 4.11.2.4This incorporates all changes after 4.10.1 up to 4.12.0.565.0.0-alpha.1 / 2014-11-067==========================8
15 unmodified lines
24 - `req.query` is now a getter instead of a plain property25 * add:26 - `app.router` is a reference to the base router27284.12.0 / 2015-02-2329===================3031 * Fix `"trust proxy"` setting to inherit when app is mounted32 * Generate `ETag`s for all request responses33 - No longer restricted to only responses for `GET` and `HEAD` requests34 * Use `content-type` to parse `Content-Type` headers35 * deps: accepts@~1.2.436 - Fix preference sorting to be stable for long acceptable lists37 - deps: mime-types@~2.0.938 - deps: negotiator@0.5.139 * deps: cookie-signature@1.0.640 * deps: send@0.12.141 - Always read the stat size from the file42 - Fix mutating passed-in `options`43 - deps: mime@1.3.444 * deps: serve-static@~1.9.145 - deps: send@0.12.146 * deps: type-is@~1.6.047 - fix argument reassignment48 - fix false-positives in `hasBody` `Transfer-Encoding` check49 - support wildcard for both type and subtype (`*/*`)50 - deps: mime-types@~2.0.951524.11.2 / 2015-02-0153===================5455 * Fix `res.redirect` double-calling `res.end` for `HEAD` requests
672 unmodified lines
728 - `app.router()` - returns the app Router instance729 - `app.route()` - Proxy to the app's `Router#route()` method to create a new route730 - Router & Route - public API7317323.20.0 / 2015-02-18733===================734735 * Fix `"trust proxy"` setting to inherit when app is mounted736 * Generate `ETag`s for all request responses737 - No longer restricted to only responses for `GET` and `HEAD` requests738 * Use `content-type` to parse `Content-Type` headers739 * deps: connect@2.29.0740 - Use `content-type` to parse `Content-Type` headers741 - deps: body-parser@~1.12.0742 - deps: compression@~1.4.1743 - deps: connect-timeout@~1.6.0744 - deps: cookie-parser@~1.3.4745 - deps: cookie-signature@1.0.6746 - deps: csurf@~1.7.0747 - deps: errorhandler@~1.3.4748 - deps: express-session@~1.10.3749 - deps: http-errors@~1.3.1750 - deps: response-time@~2.3.0751 - deps: serve-index@~1.6.2752 - deps: serve-static@~1.9.1753 - deps: type-is@~1.6.0754 * deps: cookie-signature@1.0.6755 * deps: send@0.12.1756 - Always read the stat size from the file757 - Fix mutating passed-in `options`758 - deps: mime@1.3.47597603.19.2 / 2015-02-01761===================762763 * deps: connect@2.28.3
1960 unmodified lines
modified:LICENSE+2 added
1(The MIT License)23Copyright (c) 2009-2014 TJ Holowaychuk <tj@vision-media.ca>4Copyright (c) 2013-2014 Roman Shtylman <shtylman+expressjs@gmail.com>5Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com>67Permission is hereby granted, free of charge, to any person obtaining8a copy of this software and associated documentation files (the9'Software'), to deal in the Software without restriction, including
15 unmodified lines
modified:package.json+15 added-15 removed
25 unmodified lines
26 "app",27 "api"28 ],29 "dependencies": {30 "accepts": "~1.2.3",30 "accepts": "~1.2.4",31 "content-disposition": "0.5.0",32 "content-type": "~1.0.1",32 "cookie-signature": "1.0.5",33 "cookie-signature": "1.0.6",34 "debug": "~2.1.1",35 "depd": "~1.0.0",36 "escape-html": "1.0.1",37 "etag": "~1.5.1",38 "finalhandler": "0.3.3",39 "fresh": "0.2.4",39 "media-typer": "0.3.0",40 "methods": "~1.1.1",41 "on-finished": "~2.2.0",42 "parseurl": "~1.3.0",43 "path-to-regexp": "0.1.3",44 "proxy-addr": "~1.0.6",45 "qs": "2.3.3",46 "range-parser": "~1.0.2",47 "send": "0.11.1",48 "serve-static": "~1.8.1",49 "type-is": "~1.5.6",47 "send": "0.12.1",48 "serve-static": "~1.9.1",49 "type-is": "~1.6.0",50 "vary": "~1.0.0",51 "cookie": "0.1.2",52 "merge-descriptors": "0.0.2",53 "utils-merge": "1.0.0"54 },55 "devDependencies": {56 "after": "0.8.1",57 "ejs": "2.1.4",58 "istanbul": "0.3.5",57 "ejs": "2.3.1",58 "istanbul": "0.3.6",59 "marked": "0.3.3",60 "mocha": "~2.1.0",61 "should": "~4.6.2",61 "should": "~5.0.1",62 "supertest": "~0.15.0",63 "hjs": "~0.0.6",64 "body-parser": "~1.11.0",64 "body-parser": "~1.12.0",65 "connect-redis": "~2.2.0",66 "cookie-parser": "~1.3.3",67 "express-session": "~1.10.2",68 "jade": "~1.9.1",66 "cookie-parser": "~1.3.4",67 "express-session": "~1.10.3",68 "jade": "~1.9.2",69 "method-override": "~2.3.1",70 "morgan": "~1.5.1",71 "multiparty": "~4.1.1",72 "vhost": "~3.0.0"
9 unmodified lines
82 "lib/"83 ],84 "scripts": {85 "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",86 "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/",87 "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",87 "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/",88 "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/"88 "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"89 }90}
modified:Readme.md+10 added-7 removed
2 unmodified lines
3 Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).45 [![NPM Version][npm-image]][npm-url]6 [![NPM Downloads][downloads-image]][downloads-url]7 [![Build Status][travis-image]][travis-url]7 [![Linux Build][travis-image]][travis-url]8 [![Windows Build][appveyor-image]][appveyor-url]9 [![Test Coverage][coveralls-image]][coveralls-url]1011```js12var express = require('express')
108 unmodified lines
121## License122123 [MIT](LICENSE)124124[npm-image]: https://img.shields.io/npm/v/express.svg?style=flat125[npm-image]: https://img.shields.io/npm/v/express.svg126[npm-url]: https://npmjs.org/package/express126[downloads-image]: https://img.shields.io/npm/dm/express.svg?style=flat127[downloads-image]: https://img.shields.io/npm/dm/express.svg128[downloads-url]: https://npmjs.org/package/express128[travis-image]: https://img.shields.io/travis/strongloop/express.svg?style=flat129[travis-image]: https://img.shields.io/travis/strongloop/express/master.svg?label=linux130[travis-url]: https://travis-ci.org/strongloop/express131[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows132[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express130[coveralls-image]: https://img.shields.io/coveralls/strongloop/express.svg?style=flat133[coveralls-image]: https://img.shields.io/coveralls/strongloop/express/master.svg134[coveralls-url]: https://coveralls.io/r/strongloop/express?branch=master132[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg?style=flat135[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg136[gratipay-url-visionmedia]: https://gratipay.com/visionmedia/134[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg?style=flat137[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg138[gratipay-url-dougwilson]: https://gratipay.com/dougwilson/