Merge tag '4.15.4'
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 21f725e, a4bd437 · Browse files · 92 files·+495 added−266 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
92 files+495 added−266 removed
- tests:+126 added−69 removed
- other:+369 added−197 removed
Provenance
- Commit
c319fe2- Tree
a8e492c- Author
Douglas Christopher Wilson <doug@somethingdoug.com>- Committer
Douglas Christopher Wilson <doug@somethingdoug.com>- Parent 1
21f725e- Parent 2
a4bd437
92 files changed+495 added−266 removed
modified:benchmarks/middleware.js-1 removed
12234517 unmodified lines
var http = require('http');var express = require('..');var app = express();
// number of middleware17 unmodified linesmodified:examples/content-negotiation/db.js+1 added-1 removed
2 unmodified lines3456772 unmodified linesusers.push({ name: 'Tobi' });users.push({ name: 'Loki' });users.push({ name: 'Jane' });
module.exports = users;No newline at end of filemodule.exports = users;modified:examples/cookie-sessions/index.js+2 added-3 removed
13 unmodified lines141516171819201819202122233 unmodified lines13 unmodified linesapp.use(count);
// custom middlewarefunction count(req, res) { req.session.count = req.session.count || 0; var n = req.session.count++; res.send('viewed ' + n + ' times\n'); req.session.count = (req.session.count || 0) + 1 res.send('viewed ' + req.session.count + ' times\n')}
/* istanbul ignore next */if (!module.parent) {3 unmodified linesmodified:examples/ejs/index.js+1 added-1 removed
24 unmodified lines2526272829293031323322 unmodified lines24 unmodified linesapp.set('views', path.join(__dirname, 'views'));
// Path to our public directory
app.use(express.static(path.join(__dirname + 'public')));app.use(express.static(path.join(__dirname, 'public')));
// Without this you would need to// supply the extension to res.render()// ex: res.render('users.html').22 unmodified linesmodified:examples/mvc/controllers/main/index.js+1 added-1 removed
1233exports.index = function(req, res){ res.redirect('/users');};No newline at end of file};added:examples/mvc/controllers/user/views/edit.hbs+25 added
1+<!DOCTYPE html>2+<html>3+<head>4+ <link rel="stylesheet" href="/style.css">5+ <title>Edit {{user.name}}</title>6+</head>7+<body>8+ <h1>{{user.name}}</h1>9+ <form action="/user/{{user.id}}?_method=put" method="post">10+ <label for="user[name]">Name:11+ <input type="text" name="user[name]" value="{{user.name}}">12+ </label>13+14+ <input type="submit" name="submit" value="Update">15+ </form>16+17+ <form action="/user/{{user.id}}/pet" method="post">18+ <label for="pet[name]">Pet:19+ <input type="text" name="pet[name]" placeholder="Pet Name">20+ </label>21+22+ <input type="submit" name="submit" value="Add">23+ </form>24+</body>25+</html>deleted:examples/mvc/controllers/user/views/edit.jade-11 removed
1-link(rel='stylesheet', href='/style.css')2-h1= user.name3-form(action='/user/#{user.id}?_method=put', method='post')4- label= 'Name: '5- input(type='text', name='user[name]', value='#{user.name}')6- input(type='submit', value='Update')7-8-form(action='/user/#{user.id}/pet', method='post')9- label= 'Pet: '10- input(type='text', name='pet[name]', placeholder='Name')11- input(type='submit', value='Add')added:examples/mvc/controllers/user/views/list.hbs+16 added
1+<!DOCTYPE html>2+<html>3+<head>4+ <link rel="stylesheet" href="/style.css">5+ <title>Users</title>6+</head>7+<body>8+ <h1>Users</h1>9+ <p>Click a user below to view their pets.</p>10+ <ul>11+ {{#each users}}12+ <li><a href="/user/{{id}}">{{name}}</a></li>13+ {{/each}}14+ </ul>15+</body>16+</html>deleted:examples/mvc/controllers/user/views/list.jade-7 removed
1-link(rel='stylesheet', href='/style.css')2-h1 Users3-p Click a user below to view their pets.4-ul5- each user in users6- li7- a(href='/user/#{user.id}')= user.nameadded:examples/mvc/controllers/user/views/show.hbs+29 added
1+<!DOCTYPE html>2+<html>3+<head>4+ <link rel="stylesheet" href="/style.css">5+ <title>{{user.name}}</title>6+</head>7+<body>8+<h1>{{user.name}} <a href="/user/{{user.id}}/edit">edit</a></h1>9+10+{{#if hasMessages}}11+ <ul>12+ {{#each messages}}13+ <li>{{this}}</li>14+ {{/each}}15+ </ul>16+{{/if}}17+18+{{#if user.pets.length}}19+ <p>View {{user.name}}'s pets:</p>20+ <ul>21+ {{#each user.pets}}22+ <li><a href="/pet/{{id}}">{{name}}</a></li>23+ {{/each}}24+ </ul>25+{{else}}26+ <p>No pets!</p>27+{{/if}}28+</body>29+</html>deleted:examples/mvc/controllers/user/views/show.jade-17 removed
1-link(rel='stylesheet', href='/style.css')2-h1= user.name + ' '3- a(href='/user/#{user.id}/edit') edit4-5-if (hasMessages)6- ul#messages7- each msg in messages8- li= msg9-10-if (user.pets.length)11- p View #{user.name}'s pets:12- ul13- each pet in user.pets14- li15- a(href='/pet/#{pet.id}')= pet.name16-else17- p No pets!modified:examples/mvc/controllers/user/index.js+2 added
2 unmodified lines3 */4 5 var db = require('../../db');6 7+exports.engine = 'hbs';8+9 exports.before = function(req, res, next){10 var id = req.params.user_id;11 if (!id) return next();12 // pretend to query a database...27 unmodified linesadded:examples/mvc/views/404.ejs+12 added
1+<!DOCTYPE html>2+<html>3+ <head>4+ <meta charset="utf-8">5+ <title>Not Found</title>6+ <link rel="stylesheet" href="/style.css">7+ </head>8+ <body>9+ <h1>404: Not Found</h1>10+ <p>Sorry we can't find <%= url %></p>11+ </body>12+</html>deleted:examples/mvc/views/404.jade-3 removed
1-link(rel='stylesheet', href='/style.css')2-h1 404: Not Found3-p Sorry we can't find #{url}added:examples/mvc/views/5xx.ejs+12 added
1+<!DOCTYPE html>2+<html>3+ <head>4+ <meta charset="utf-8">5+ <title>Internal Server Error</title>6+ <link rel="stylesheet" href="/style.css">7+ </head>8+ <body>9+ <h1>500: Internal Server Error</h1>10+ <p>Looks like something blew up!</p>11+ </body>12+</html>deleted:examples/mvc/views/5xx.jade-3 removed
1-link(rel='stylesheet', href='/style.css')2-h1 500: Internal Server Error3-p Looks like something blew up!modified:examples/mvc/db.js+1 added-1 removed
9 unmodified lines10 var users = exports.users = [];11 12 users.push({ name: 'TJ', pets: [pets[0], pets[1], pets[2]], id: 0 });13 users.push({ name: 'Guillermo', pets: [pets[3]], id: 1 });14-users.push({ name: 'Nathan', pets: [], id: 2 });14+users.push({ name: 'Nathan', pets: [], id: 2 });modified:examples/mvc/index.js+3 added-5 removed
9 unmodified lines10 var methodOverride = require('method-override');11 12 var app = module.exports = express();13 14-// settings14+// set our default template engine to "ejs"15+// which prevents the need for using file extensions16+app.set('view engine', 'ejs');17 16-// set our default template engine to "jade"17-// which prevents the need for extensions18-app.set('view engine', 'jade');19-18 // set views for error and 404 pages19 app.set('views', path.join(__dirname, 'views'));20 21 // define a custom res.message() method73 unmodified linesmodified:examples/online/index.js+5 added-1 removed
1-// first:1+2+// install redis first:3+// https://redis.io/4+5+// then:6 // $ npm install redis online7 // $ redis-server8 9 /**51 unmodified linesmodified:examples/params/index.js+1 added-1 removed
66 unmodified lines67 app.get('/users/:from-:to', function(req, res, next){68 var from = req.params.from;69 var to = req.params.to;70 var names = users.map(function(user){ return user.name; });71- res.send('users ' + names.slice(from, to).join(', '));71+ res.send('users ' + names.slice(from, to + 1).join(', '));72 });73 74 /* istanbul ignore next */75 if (!module.parent) {3 unmodified linesmodified:examples/resource/index.js+1 added-1 removed
73 unmodified lines74 app.resource('/users', User);75 76 app.get('/', function(req, res){77 res.send([78- '<h1>Examples:</h1> <ul>'78+ '<h1>Examples:</h1> <ul>'79 , '<li>GET /users</li>'80 , '<li>GET /users/1</li>'81 , '<li>GET /users/3</li>'82 , '<li>GET /users/1..3</li>'11 unmodified linesadded:examples/route-separation/views/posts/index.ejs+12 added
1+<% include ../header %>2+3+<h1>Posts</h1>4+5+<dl id="posts">6+ <% posts.forEach(function(post) { %>7+ <dt><%= post.title %></dt>8+ <dd><%= post.body %></dd>9+ <% }) %>10+</dl>11+12+<% include ../footer %>deleted:examples/route-separation/views/posts/index.jade-8 removed
1-extends ../layout2-3-block content4- h1 Posts5- dl#posts6- for post in posts7- dt= post.title8- dd= post.bodyadded:examples/route-separation/views/users/edit.ejs+23 added
1+<% include ../header %>2+3+<h1>Editing <%= user.name %></h1>4+5+<div id="user">6+ <form action="?_method=put", method="post">7+ <p>8+ Name:9+ <input type="text" value="<%= user.name %>" name="user[name]" />10+ </p>11+12+ <p>13+ Email:14+ <input type="email" value="<%= user.email %>" name="user[email]" />15+ </p>16+17+ <p>18+ <input type="submit" value="Save" />19+ </p>20+ </form>21+</div>22+23+<% include ../footer %>deleted:examples/route-separation/views/users/edit.jade-12 removed
1-extends ../layout2-3-block content4- h1 Editing #{user.name}5- #user6- form(action="?_method=put", method="post")7- p Name: 8- input(type="text", value= user.name, name="user[name]")9- p Email: 10- input(type="text", value= user.email, name="user[email]")11- p 12- input(type="submit", value="Save")added:examples/route-separation/views/users/index.ejs+14 added
1+<% include ../header %>2+3+<h1><%= title %></h1>4+5+<div id="users">6+ <% users.forEach(function(user, index) { %>7+ <li>8+ <a href="/user/<%= index %>"><%= user.name %></a>9+ <a href="/user/<%= index %>/edit">edit</a>10+ </li>11+ <% }) %>12+</div>13+14+<% include ../footer %>deleted:examples/route-separation/views/users/index.jade-9 removed
1-extends ../layout2-3-block content4- h1 Users5- #users6- for user, i in users7- li8- a(href="/user/#{i}")= user.name9- a.edit(href="/user/#{i}/edit") editadded:examples/route-separation/views/users/view.ejs+9 added
1+<% include ../header %>2+3+<h1><%= user.name %></h1>4+5+<div id="user">6+ <p>Email: <%= user.email %></p>7+</div>8+9+<% include ../footer %>deleted:examples/route-separation/views/users/view.jade-6 removed
1-extends ../layout2-3-block content4- h1= user.name5- #user6- p Email: #{user.email}added:examples/route-separation/views/footer.ejs+2 added
1+</body>2+</html>added:examples/route-separation/views/header.ejs+8 added
1+<!DOCTYPE html>2+<html lang="en">3+<head>4+ <meta charset="utf-8">5+ <title><%= title %></title>6+ <link rel="stylesheet" href="/style.css">7+</head>8+<body>added:examples/route-separation/views/index.ejs+10 added
1+<% include header %>2+3+<h1><%= title %></h1>4+5+<ul>6+ <li>Visit the <a href="/users">users</a> page.</li>7+ <li>Visit the <a href="/posts">posts</a> page.</li>8+</ul>9+10+<% include footer %>deleted:examples/route-separation/views/index.jade-6 removed
1-extends layout2-3-block content4- ul5- li Visit the <a href="/users">users</a> page6- li Visit the <a href="/posts">posts</a> pagedeleted:examples/route-separation/views/layout.jade-6 removed
1-html2- head3- title= title4- link(href="/style.css", rel="stylesheet")5- body6- block contentmodified:examples/route-separation/index.js+1 added-1 removed
15 unmodified lines16 module.exports = app;17 18 // Config19 20-app.set('view engine', 'jade');20+app.set('view engine', 'ejs');21 app.set('views', path.join(__dirname, 'views'));22 23 /* istanbul ignore next */24 if (!module.parent) {30 unmodified linesmodified:examples/route-separation/site.js+1 added-1 removed
1 exports.index = function(req, res){2 res.render('index', { title: 'Route Separation Example' });3-};3+};modified:examples/search/public/client.js+1 added-1 removed
8 unmodified lines9 code.textContent = xhr.responseText;10 }11 };12 xhr.send();13-}, false);13+}, false);modified:examples/search/index.js+5 added-1 removed
1-// first:1+2+// install redis first:3+// https://redis.io/4+5+// then:6 // $ npm install redis7 // $ redis-server8 9 /**51 unmodified linesmodified:examples/session/index.js+5 added-1 removed
1-// first:1+2+// install redis first:3+// https://redis.io/4+5+// then:6 // $ npm install redis7 // $ redis-server8 9 var express = require('../..');27 unmodified linesmodified:examples/static-files/public/js/app.js+1 added-1 removed
1-foo1+foomodified:examples/view-constructor/github-view.js+1 added-1 removed
1 /**2 * Module dependencies.3 */4 5-var http = require('http');5+var https = require('https');6 var path = require('path');7 var extname = path.extname;8 9 /**42 unmodified linesmodified:examples/view-constructor/index.js-1 removed
1 unmodified line2 * Module dependencies.3 */4 5 var express = require('../../');6-var http = require('http');6 var GithubView = require('./github-view');7 var md = require('marked').parse;8 9 var app = module.exports = express();37 unmodified linesadded:examples/view-locals/views/index.ejs+19 added
1+<!DOCTYPE html>2+<html>3+ <head>4+ <meta charset="utf-8">5+ <title><%= title %></title>6+ <style media="screen">7+ body {8+ padding: 50px;9+ font: 16px Helvetica, Arial;10+ }11+ </style>12+ </head>13+ <body>14+ <h2><%= title %></h2>15+ <% users.forEach(function(user) { %>16+ <li><strong><%= user.name %></strong> is a <% user.age %> year old <%= user.species %></li>17+ <% }); %>18+ </body>19+</html>modified:examples/view-locals/index.js+6 added-5 removed
1 unmodified line2 * Module dependencies.3 */4 5 var express = require('../..');6+var path = require('path');7 var User = require('./user');8 var app = express();9 9-app.set('views', __dirname);10-app.set('view engine', 'jade');10+app.set('views', path.join(__dirname, 'views'));11+app.set('view engine', 'ejs');12 13 // filter ferrets only14 15 function ferrets(user) {9 unmodified lines25 User.count(function(err, count){26 if (err) return next(err);27 User.all(function(err, users){28 if (err) return next(err);28- res.render('user', {29+ res.render('index', {30 title: 'Users',31 count: count,32 users: users.filter(ferrets)33 });25 unmodified lines59 })60 }61 62 app.get('/middleware', count, users, function(req, res, next){62- res.render('user', {63+ res.render('index', {64 title: 'Users',65 count: req.count,66 users: req.users.filter(ferrets)67 });33 unmodified lines101 // you can see now how we have much less102 // to pass to res.render(). If we have103 // several routes related to users this104 // can be a great productivity booster104- res.render('user', { title: 'Users' });105+ res.render('index', { title: 'Users' });106 });107 108 // keep in mind that middleware may be placed anywhere109 // and in various combinations, so if you have locals44 unmodified linesdeleted:examples/view-locals/layout.jade-12 removed
1-doctype html2-html3- head4- title= title5- style.6- body {7- padding: 50px;8- font: 16px Helvetica, Arial;9- }10- body11- h2= title12- block contentdeleted:examples/view-locals/user.jade-8 removed
1-2-extends layout3-4-block content5- for user in users6- .user7- h3= user.name8- p #{user.name} is a #{user.age} year old #{user.species}.modified:examples/web-service/index.js+1 added-1 removed
59 unmodified lines60 , { name: 'jane' }61 ];62 63 var userRepos = {64- tobi: [repos[0], repos[1]]64+ tobi: [repos[0], repos[1]]65 , loki: [repos[1]]66 , jane: [repos[2]]67 };68 44 unmodified linesmodified:lib/application.js+9 added-9 removed
23 unmodified lines24 var flatten = require('array-flatten');25 var merge = require('utils-merge');26 var resolve = require('path').resolve;27 var Router = require('router');28-var setPrototyeOf = require('setprototypeof')28+var setPrototypeOf = require('setprototypeof')29 var slice = Array.prototype.slice;30 31 /**32 * Application prototype.76 unmodified lines109 delete this.settings['trust proxy fn'];110 }111 112 // inherit protos113- setPrototyeOf(this.request, parent.request)114- setPrototyeOf(this.response, parent.response)115- setPrototyeOf(this.engines, parent.engines)116- setPrototyeOf(this.settings, parent.settings)113+ setPrototypeOf(this.request, parent.request)114+ setPrototypeOf(this.response, parent.response)115+ setPrototypeOf(this.engines, parent.engines)116+ setPrototypeOf(this.settings, parent.settings)117 });118 119 // setup locals120 this.locals = Object.create(null);39 unmodified lines160 req.res = res;161 res.req = req;162 163 // alter the prototypes164- setPrototyeOf(req, this.request)165- setPrototyeOf(res, this.response)164+ setPrototypeOf(req, this.request)165+ setPrototypeOf(res, this.response)166 167 // setup locals168 if (!res.locals) {169 res.locals = Object.create(null);54 unmodified lines224 // restore .app property on req and res225 router.use(path, function mounted_app(req, res, next) {226 var orig = req.app;227 fn.handle(req, res, function (err) {228- setPrototyeOf(req, orig.request)229- setPrototyeOf(res, orig.response)228+ setPrototypeOf(req, orig.request)229+ setPrototypeOf(res, orig.response)230 next(err);231 });232 });233 397 unmodified linesmodified:lib/response.js+9 added-4 removed
595 unmodified lines596 ? val.map(String)597 : String(val);598 599 // add charset to content-type600+ if (field.toLowerCase() === 'content-type') {601+ if (Array.isArray(value)) {602+ throw new TypeError('Content-Type cannot be set to an Array');603+ }600- if (field.toLowerCase() === 'content-type' && !charsetRegExp.test(value)) {601- var charset = mime.charsets.lookup(value.split(';')[0]);602- if (charset) value += '; charset=' + charset.toLowerCase();604+ if (!charsetRegExp.test(value)) {605+ var charset = mime.charsets.lookup(value.split(';')[0]);606+ if (charset) value += '; charset=' + charset.toLowerCase();607+ }608 }609 610 this.setHeader(field, value);611 } else {49 unmodified lines661 * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })662 *663 * @param {String} name664 * @param {String|Object} value660- * @param {Options} options665+ * @param {Object} [options]666 * @return {ServerResponse} for chaining667 * @public668 */669 281 unmodified linesmodified:lib/utils.js-1 removed
13 unmodified lines14 15 var mime = require('send').mime;16 var contentType = require('content-type');17 var etag = require('etag');18-var flatten = require('array-flatten');18 var proxyaddr = require('proxy-addr');19 var qs = require('qs');20 var querystring = require('querystring');21 225 unmodified linesmodified:lib/view.js-1 removed
14 unmodified lines15 16 var debug = require('debug')('express:view');17 var path = require('path');18 var fs = require('fs');19-var utils = require('./utils');19 20 /**21 * Module variables.22 * @private175 unmodified linesmodified:test/acceptance/cookie-sessions.js+3 added-3 removed
5 unmodified lines6 describe('GET /', function () {7 it('should display no views', function (done) {8 request(app)9 .get('/')10- .expect(200, 'viewed 0 times\n', done)10+ .expect(200, 'viewed 1 times\n', done)11 })12 13 it('should set a session cookie', function (done) {14 request(app)4 unmodified lines19 20 it('should display 1 view on revisit', function (done) {21 request(app)22 .get('/')23- .expect(200, 'viewed 0 times\n', function (err, res) {23+ .expect(200, 'viewed 1 times\n', function (err, res) {24 if (err) return done(err)25 request(app)26 .get('/')27 .set('Cookie', getCookies(res))28- .expect(200, 'viewed 1 times\n', done)28+ .expect(200, 'viewed 2 times\n', done)29 })30 })31 })32 })6 unmodified linesmodified:test/acceptance/error-pages.js+1 added-1 removed
97 unmodified lines98 .expect(500, done)99 })100 })101 })102-})102+})modified:test/acceptance/error.js+1 added-1 removed
24 unmodified lines25 .get('/missing')26 .expect(404,done)27 })28 })29-})29+})modified:test/acceptance/params.js+2 added-2 removed
27 unmodified lines28 29 describe('GET /users/0-2', function(){30 it('should respond with three users', function(done){31 request(app)32- .get('/users/0-2')33- .expect(/users tj, tobi/,done)32+ .get('/users/0-2')33+ .expect(/users tj, tobi, loki/, done)34 })35 })36 37 describe('GET /users/foo-bar', function(){7 unmodified linesmodified:test/acceptance/route-map.js+1 added-1 removed
40 unmodified lines41 .del('/users/12/pets/2')42 .expect('delete 12\'s pet 2', done);43 })44 })45-})45+})modified:test/app.engine.js+2 added-2 removed
45 unmodified lines46 str.should.equal('<p>tobi</p>');47 done();48 })49 })50- 50+51 it('should work "view engine" setting', function(done){52 var app = express();53 54 app.set('views', path.join(__dirname, 'fixtures'))6 unmodified lines61 str.should.equal('<p>tobi</p>');62 done();63 })64 })65- 65+66 it('should work "view engine" with leading "."', function(done){67 var app = express();68 69 app.set('views', path.join(__dirname, 'fixtures'))12 unmodified linesmodified:test/app.js+2 added-2 removed
72 unmodified lines73 describe('in development', function(){74 it('should disable "view cache"', function(){75 process.env.NODE_ENV = 'development';76 var app = express();77- app.enabled('view cache').should.be.false;77+ app.enabled('view cache').should.be.false()78 process.env.NODE_ENV = 'test';79 })80 })81 82 describe('in production', function(){83 it('should enable "view cache"', function(){84 process.env.NODE_ENV = 'production';85 var app = express();86- app.enabled('view cache').should.be.true;86+ app.enabled('view cache').should.be.true()87 process.env.NODE_ENV = 'test';88 })89 })90 8 unmodified linesmodified:test/app.listen.js-1 removed
1 2 var express = require('../')3- , request = require('supertest');3 4 describe('app.listen()', function(){5 it('should wrap with an HTTP server', function(done){6 var app = express();11 unmodified linesmodified:test/app.locals.js-1 removed
1 2 var express = require('../')3- , request = require('supertest');3 4 describe('app', function(){5 describe('.locals(obj)', function(){6 it('should merge locals', function(){20 unmodified linesmodified:test/app.param.js+3 added-3 removed
14 unmodified lines15 });16 17 app.get('/post/:id', function(req, res){18 var id = req.params.id;19- id.should.be.a.Number;19+ id.should.be.a.Number()20 res.send('' + id);21 });22 23 app.get('/user/:uid', function(req, res){24 var id = req.params.id;25- id.should.be.a.Number;25+ id.should.be.a.Number()26 res.send('' + id);27 });28 29 request(app)19 unmodified lines49 });50 51 app.get('/user/:id', function(req, res){52 var id = req.params.id;53- id.should.be.a.Number;53+ id.should.be.a.Number()54 res.send('' + id);55 });56 57 request(app)268 unmodified linesmodified:test/app.render.js+1 added-1 removed
70 unmodified lines71 72 app.set('view', View);73 74 app.render('something', function(err, str){75- err.should.be.ok;75+ err.should.be.ok()76 err.message.should.equal('err!');77 done();78 })79 })296 unmodified linesmodified:test/app.router.js-1 removed
37 unmodified lines38 if (method === 'connect') return;39 40 it('should include ' + method.toUpperCase(), function(done){41 var app = express();42- var calls = [];42 43 app[method]('/foo', function(req, res){44 if ('head' == method) {45 res.end();1043 unmodified linesmodified:test/app.routes.error.js+4 added-4 removed
42 unmodified lines43 }, function(err, req, res, next){44 d = true;45 next();46 }, function(req, res){47- a.should.be.false;48- b.should.be.true;49- c.should.be.true;50- d.should.be.false;47+ a.should.be.false()48+ b.should.be.true()49+ c.should.be.true()50+ d.should.be.false()51 res.sendStatus(204);52 });53 54 request(app)5 unmodified linesmodified:test/config.js+6 added-6 removed
47 unmodified lines48 it('should return undefined when unset', function(){49 var app = express();50 assert.strictEqual(app.get('foo'), undefined);51 })52- 52+53 it('should otherwise return the value', function(){54 var app = express();55 app.set('foo', 'bar');56 assert.equal(app.get('foo'), 'bar');67 unmodified lines124 assert.equal(app.enable('tobi'), app);125 assert.strictEqual(app.get('tobi'), true);126 })127 })128- 128+129 describe('.disable()', function(){130 it('should set the value to false', function(){131 var app = express();132 assert.equal(app.disable('tobi'), app);133 assert.strictEqual(app.get('tobi'), false);134 })135 })136- 136+137 describe('.enabled()', function(){138 it('should default to false', function(){139 var app = express();140 assert.strictEqual(app.enabled('foo'), false);141 })142- 142+143 it('should return true when set', function(){144 var app = express();145 app.set('foo', 'bar');146 assert.strictEqual(app.enabled('foo'), true);147 })148 })149- 149+150 describe('.disabled()', function(){151 it('should default to true', function(){152 var app = express();153 assert.strictEqual(app.disabled('foo'), true);154 })155- 155+156 it('should return false when set', function(){157 var app = express();158 app.set('foo', 'bar');159 assert.strictEqual(app.disabled('foo'), false);3 unmodified linesmodified:test/exports.js+4 added-5 removed
1 2 var express = require('../');3 var request = require('supertest');4-var should = require('should');4 5 describe('exports', function(){6 it('should expose Router', function(){8- express.Router.should.be.a.Function;7+ express.Router.should.be.a.Function()8 })9 10 it('should expose the application prototype', function(){12- express.application.set.should.be.a.Function;11+ express.application.set.should.be.a.Function()12 })13 14 it('should expose the request prototype', function(){16- express.request.accepts.should.be.a.Function;15+ express.request.accepts.should.be.a.Function()16 })17 18 it('should expose the response prototype', function(){20- express.response.send.should.be.a.Function;19+ express.response.send.should.be.a.Function()20 })21 22 it('should permit modifying the .application prototype', function(){23 express.application.foo = function(){ return 'bar'; };29 unmodified linesmodified:test/req.acceptsEncodings.js+3 added-3 removed
6 unmodified lines7 it('should be true if encoding accepted', function(done){8 var app = express();9 10 app.use(function(req, res){11- req.acceptsEncodings('gzip').should.be.ok;12- req.acceptsEncodings('deflate').should.be.ok;11+ req.acceptsEncodings('gzip').should.be.ok()12+ req.acceptsEncodings('deflate').should.be.ok()13 res.end();14 });15 16 request(app)5 unmodified lines22 it('should be false if encoding not accepted', function(done){23 var app = express();24 25 app.use(function(req, res){26- req.acceptsEncodings('bogus').should.not.be.ok;26+ req.acceptsEncodings('bogus').should.not.be.ok()27 res.end();28 });29 30 request(app)6 unmodified linesmodified:test/req.acceptsLanguages.js+6 added-6 removed
6 unmodified lines7 it('should be true if language accepted', function(done){8 var app = express();9 10 app.use(function(req, res){11- req.acceptsLanguages('en-us').should.be.ok;12- req.acceptsLanguages('en').should.be.ok;11+ req.acceptsLanguages('en-us').should.be.ok()12+ req.acceptsLanguages('en').should.be.ok()13 res.end();14 });15 16 request(app)5 unmodified lines22 it('should be false if language not accepted', function(done){23 var app = express();24 25 app.use(function(req, res){26- req.acceptsLanguages('es').should.not.be.ok;26+ req.acceptsLanguages('es').should.not.be.ok()27 res.end();28 });29 30 request(app)6 unmodified lines37 it('should always return true', function(done){38 var app = express();39 40 app.use(function(req, res){41- req.acceptsLanguages('en').should.be.ok;42- req.acceptsLanguages('es').should.be.ok;43- req.acceptsLanguages('jp').should.be.ok;41+ req.acceptsLanguages('en').should.be.ok()42+ req.acceptsLanguages('es').should.be.ok()43+ req.acceptsLanguages('jp').should.be.ok()44 res.end();45 });46 47 request(app)6 unmodified linesmodified:test/req.host.js-1 removed
1 2 var express = require('../')3 , request = require('supertest')4- , assert = require('assert');4 5 describe('req', function(){6 describe('.host', function(){7 it('should return the Host when present', function(done){148 unmodified linesmodified:test/req.hostname.js-1 removed
1 2 var express = require('../')3 , request = require('supertest')4- , assert = require('assert');4 5 describe('req', function(){6 describe('.hostname', function(){7 it('should return the Host when present', function(done){130 unmodified linesmodified:test/req.range.js-1 removed
1 2-var assert = require('assert');2 var express = require('..');3 var request = require('supertest')4 5 describe('req', function(){98 unmodified linesmodified:test/req.xhr.js+4 added-4 removed
6 unmodified lines7 it('should return true when X-Requested-With is xmlhttprequest', function(done){8 var app = express();9 10 app.use(function(req, res){11- req.xhr.should.be.true;11+ req.xhr.should.be.true()12 res.end();13 });14 15 request(app)8 unmodified lines24 it('should case-insensitive', function(done){25 var app = express();26 27 app.use(function(req, res){28- req.xhr.should.be.true;28+ req.xhr.should.be.true()29 res.end();30 });31 32 request(app)8 unmodified lines41 it('should return false otherwise', function(done){42 var app = express();43 44 app.use(function(req, res){45- req.xhr.should.be.false;45+ req.xhr.should.be.false()46 res.end();47 });48 49 request(app)8 unmodified lines58 it('should return false when not present', function(done){59 var app = express();60 61 app.use(function(req, res){62- req.xhr.should.be.false;62+ req.xhr.should.be.false()63 res.end();64 });65 66 request(app)8 unmodified linesmodified:test/res.download.js-1 removed
87 unmodified lines88 })89 90 it('should remove Content-Disposition', function(done){91 var app = express()92- , calls = 0;92 93 app.use(function (req, res, next) {94 res.download('test/fixtures/foobar.html', function(err){95 if (!err) return next(new Error('expected error'));17 unmodified linesmodified:test/res.format.js-1 removed
1 2 var express = require('../')3 , request = require('supertest')4- , utils = require('../lib/utils')4 , assert = require('assert');5 6 var app1 = express();7 205 unmodified linesmodified:test/res.location.js+58 added
40 unmodified lines41 .get('/')42 .expect('Location', 'https://google.com?q=%A710')43 .expect(200, done)44 })45+46+ describe('when url is "back"', function () {47+ it('should set location from "Referer" header', function (done) {48+ var app = express()49+50+ app.use(function (req, res) {51+ res.location('back').end()52+ })53+54+ request(app)55+ .get('/')56+ .set('Referer', '/some/page.html')57+ .expect('Location', '/some/page.html')58+ .expect(200, done)59+ })60+61+ it('should set location from "Referrer" header', function (done) {62+ var app = express()63+64+ app.use(function (req, res) {65+ res.location('back').end()66+ })67+68+ request(app)69+ .get('/')70+ .set('Referrer', '/some/page.html')71+ .expect('Location', '/some/page.html')72+ .expect(200, done)73+ })74+75+ it('should prefer "Referrer" header', function (done) {76+ var app = express()77+78+ app.use(function (req, res) {79+ res.location('back').end()80+ })81+82+ request(app)83+ .get('/')84+ .set('Referer', '/some/page1.html')85+ .set('Referrer', '/some/page2.html')86+ .expect('Location', '/some/page2.html')87+ .expect(200, done)88+ })89+90+ it('should set the header to "/" without referrer', function (done) {91+ var app = express()92+93+ app.use(function (req, res) {94+ res.location('back').end()95+ })96+97+ request(app)98+ .get('/')99+ .expect('Location', '/')100+ .expect(200, done)101+ })102+ })103 })104 })modified:test/res.send.js-1 removed
1 2-var assert = require('assert');2 var express = require('..');3 var methods = require('methods');4 var request = require('supertest');5 var utils = require('./support/utils');529 unmodified linesmodified:test/res.sendFile.js+4 added-5 removed
1 2 var after = require('after');3 var express = require('../')4 , request = require('supertest')5- , assert = require('assert');5 var onFinished = require('on-finished');6 var path = require('path');7 var should = require('should');8 var fixtures = path.join(__dirname, 'fixtures');97 unmodified lines106 test.abort();107 });108 109 app.use(function (err, req, res, next) {111- err.code.should.be.empty;110+ err.code.should.be.empty()111 cb();112 });113 114 var test = request(app).get('/');107 unmodified lines222 223 app.use(function (req, res) {224 setImmediate(function () {225 res.sendFile(path.resolve(fixtures, 'name.txt'), function (err) {227- should(err).be.ok;226+ should(err).be.ok()227 err.code.should.equal('ECONNABORTED');228 cb();229 });230 });10 unmodified lines241 242 app.use(function (req, res) {243 onFinished(res, function () {244 res.sendFile(path.resolve(fixtures, 'name.txt'), function (err) {246- should(err).be.ok;245+ should(err).be.ok()246 err.code.should.equal('ECONNABORTED');247 cb();248 });249 });42 unmodified lines292 var app = express();293 294 app.use(function (req, res) {295 res.sendFile(path.resolve(fixtures, 'does-not-exist'), function (err) {297- should(err).be.ok;296+ should(err).be.ok()297 err.status.should.equal(404);298 res.send('got it');299 });300 });25 unmodified linesmodified:test/res.sendStatus.js-1 removed
1 2-var assert = require('assert')2 var express = require('..')3 var request = require('supertest')4 5 describe('res', function () {26 unmodified linesmodified:test/res.set.js+13 added
71 unmodified lines72 .get('/')73 .expect('Content-Type', 'text/html; charset=lol')74 .expect(200, done);75 })76+77+ it('should throw when Content-Type is an array', function (done) {78+ var app = express()79+80+ app.use(function (req, res) {81+ res.set('Content-Type', ['text/html'])82+ res.end()83+ });84+85+ request(app)86+ .get('/')87+ .expect(500, /TypeError: Content-Type cannot be set to an Array/, done)88+ })89 })90 91 describe('.set(object)', function(){92 it('should set multiple fields', function(done){31 unmodified linesmodified:test/res.vary.js-1 removed
1 2-var assert = require('assert');2 var express = require('..');3 var request = require('supertest');4 var utils = require('./support/utils');5 84 unmodified linesmodified:test/Route.js+7 added-8 removed
2 unmodified lines3 var should = require('should');4 var express = require('../')5 , Route = express.Route6 , methods = require('methods')7- , assert = require('assert');7 8 describe('Route', function(){9 it('should work without handlers', function(done) {10 var req = { method: 'GET', url: '/' }12 unmodified lines23 });24 25 route.dispatch(req, {}, function (err) {26 if (err) return done(err);28- should(req.called).be.ok;27+ should(req.called).be.ok()28 done();29 });30 })31 50 unmodified lines82 })83 84 route.dispatch(req, {}, function (err) {85 if (err) return done(err);87- should(req.called).be.ok;86+ should(req.called).be.ok()87 done();88 });89 })90 11 unmodified lines102 })103 104 route.dispatch(req, {}, function (err) {105 if (err) return done(err);107- should(req.called).be.true;106+ should(req.called).be.true()107 done();108 });109 })110 43 unmodified lines154 next(err);155 });156 157 route.dispatch(req, {}, function (err) {159- should(err).be.ok;158+ should(err).be.ok()159 should(err.message).equal('foobar');160 req.order.should.equal('a');161 done();162 });17 unmodified lines180 next(err);181 });182 183 route.dispatch(req, {}, function (err) {185- should(err).be.ok;184+ should(err).be.ok()185 should(err.message).equal('foobar');186 req.order.should.equal('a');187 done();188 });31 unmodified lines220 throw new Error('boom!');221 });222 223 route.dispatch(req, {}, function(err){225- should(err).be.ok;224+ should(err).be.ok()225 err.message.should.equal('boom!');226 done();227 });228 });3 unmodified lines232 var route = new Route('');233 234 route.all(function(err, req, res, next){235 // this should not execute237- true.should.be.false;236+ true.should.be.false()237 });238 239 route.dispatch(req, {}, done);240 });2 unmodified linesmodified:test/Router.js+1 added-1 removed
45 unmodified lines46 it('should handle blank URL', function(done){47 var router = new Router();48 49 router.use(function (req, res) {50- false.should.be.true;50+ false.should.be.true()51 });52 53 router.handle({ url: '', method: 'GET' }, {}, done);54 });507 unmodified linesadded:.editorconfig+11 added
1+# http://editorconfig.org2+root = true3+4+[*]5+charset = utf-86+insert_final_newline = true7+trim_trailing_whitespace = true8+9+[{*.js,*.json,*.yml}]10+indent_size = 211+indent_style = spaceadded:.eslintignore+2 added
1+coverage2+node_modulesadded:.eslintrc+8 added
1+{2+ "rules": {3+ "eol-last": "error",4+ "indent": ["error", 2, { "SwitchCase": 1 }],5+ "no-trailing-spaces": "error",6+ "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }]7+ }8+}modified:.travis.yml+5 added-3 removed
5 unmodified lines6 - "2.5"7 - "3.3"8 - "4.8"9 - "5.12"10- - "6.10"11- - "7.6"10+ - "6.11"11+ - "7.10"12 matrix:13 include:14 - node_js: "8.0"15 env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"10 unmodified lines26 27 # Update Node.js modules28 - "test ! -d node_modules || npm prune"29 - "test ! -d node_modules || npm rebuild"30-script: "npm run-script test-ci"30+script:31+ - "npm run test-ci"32+ - "npm run lint"33 after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"modified:appveyor.yml+3 added-2 removed
5 unmodified lines6 - nodejs_version: "2.5"7 - nodejs_version: "3.3"8 - nodejs_version: "4.8"9 - nodejs_version: "5.12"10- - nodejs_version: "6.10"11- - nodejs_version: "7.6"10+ - nodejs_version: "6.11"11+ - nodejs_version: "7.10"12 cache:13 - node_modules14 install:15 - ps: Install-Product node $env:nodejs_version5 unmodified lines21 test_script:22 - node --version23 - npm --version24 - npm run test-ci25+ - npm run lint26 version: "{build}"modified:Collaborator-Guide.md+4 added-2 removed
4 unmodified lines5 6 ## PRs and Code contributions7 8 * Tests must pass.9-* Follow the [JavaScript Standard Style](http://standardjs.com/).9+* Follow the [JavaScript Standard Style](http://standardjs.com/) and `npm run lint`.10 * If you fix a bug, add a test.11 12 ## Branches13 12 unmodified lines26 3. Write your code in your local copy. It's good practice to create a branch for27 each new issue you work on, although not compulsory.28 4. To run the test suite, first install the dependencies by running `npm install`,29 then run `npm test`.30+5. Ensure your code is linted by running `npm run lint` -- fix any issue you31+ see listed.30-5. If the tests pass, you can commit your changes to your fork and then create32+6. If the tests pass, you can commit your changes to your fork and then create33 a pull request from there. Make sure to reference your issue from the pull34 request comments by including the issue number e.g. `#123`.35 36 ## Issues which are questions14 unmodified linesmodified:Contributing.md+15 added-15 removed
10 unmodified lines11 ## Vocabulary12 13 * A **Contributor** is any individual creating or commenting on an issue or pull request.14 * A **Committer** is a subset of contributors who have been given write access to the repository.15-* A **TC (Technical Committee)** is a group of committers representing the required technical 15+* A **TC (Technical Committee)** is a group of committers representing the required technical16 expertise to resolve rare disputes.17 18 # Logging Issues19 15 unmodified lines35 36 No pull request can be merged without being reviewed.37 38 For non-trivial contributions, pull requests should sit for at least 36 hours to ensure that39-contributors in other timezones have time to review. Consideration should also be given to 40-weekends and other holiday periods to ensure active committers all have reasonable time to 39+contributors in other timezones have time to review. Consideration should also be given to40+weekends and other holiday periods to ensure active committers all have reasonable time to41 become involved in the discussion and review process if they wish.42 43 The default for each contribution is that it is accepted once no committer has an objection.44-During review committers may also request that a specific contributor who is most versed in a 45-particular area gives a "LGTM" before the PR can be merged. There is no additional "sign off" 46-process for contributions to land. Once all issues brought by committers are addressed it can 44+During review committers may also request that a specific contributor who is most versed in a45+particular area gives a "LGTM" before the PR can be merged. There is no additional "sign off"46+process for contributions to land. Once all issues brought by committers are addressed it can47 be landed by any committer.48 49-In the case of an objection being raised in a pull request by another committer, all involved 50-committers should seek to arrive at a consensus by way of addressing concerns being expressed 49+In the case of an objection being raised in a pull request by another committer, all involved50+committers should seek to arrive at a consensus by way of addressing concerns being expressed51 by discussion, compromise on the proposed change, or withdrawal of the proposed change.52 53 If a contribution is controversial and committers cannot agree about how to get it to land54 or if it should land then it should be escalated to the TC. TC members should regularly55-discuss pending contributions in order to find a resolution. It is expected that only a 56-small minority of issues be brought to the TC for resolution and that discussion and 55+discuss pending contributions in order to find a resolution. It is expected that only a56+small minority of issues be brought to the TC for resolution and that discussion and57 compromise among committers be the default resolution mechanism.58 59 # Becoming a Committer60 4 unmodified lines65 proper review, and have other committers merge their pull requests.66 67 # TC Process68 69-The TC uses a "consensus seeking" process for issues that are escalated to the TC. 69+The TC uses a "consensus seeking" process for issues that are escalated to the TC.70 The group tries to find a resolution that has no open objections among TC members.71 If a consensus cannot be reached that has no objections then a majority wins vote72-is called. It is also expected that the majority of decisions made by the TC are via 72+is called. It is also expected that the majority of decisions made by the TC are via73 a consensus seeking process and that voting is only used as a last-resort.74 75-Resolution may involve returning the issue to committers with suggestions on how to 76-move forward towards a consensus. It is not expected that a meeting of the TC 75+Resolution may involve returning the issue to committers with suggestions on how to76+move forward towards a consensus. It is not expected that a meeting of the TC77 will resolve all issues on its agenda during that meeting and may prefer to continue78 the discussion happening among the committers.79 80 Members can be added to the TC at any time. Any committer can nominate another committer81 to the TC and the TC uses its standard consensus seeking process to evaluate whether or82-not to add this new member. Members who do not participate consistently at the level of 82+not to add this new member. Members who do not participate consistently at the level of83 a majority of the other members are expected to resign.84 85 modified:History.md+49 added
1+5.x2+===3+4+This incorporates all changes after 4.15.2 up to 4.15.4.5+6+ * deps: router@~1.3.17+ - deps: debug@2.6.88+9 5.0.0-alpha.5 / 2017-03-0610 ==========================11 12 This is the fifth Express 5.0 alpha release, based off 4.15.2 and includes70 unmodified lines83 - `req.query` is now a getter instead of a plain property84 * add:85 - `app.router` is a reference to the base router86 87+4.15.4 / 2017-08-0688+===================89+90+ * deps: debug@2.6.891+ * deps: depd@~1.1.192+ - Remove unnecessary `Buffer` loading93+ * deps: finalhandler@~1.0.494+ - deps: debug@2.6.895+ * deps: proxy-addr@~1.1.596+ - Fix array argument being altered97+ - deps: ipaddr.js@1.4.098+ * deps: qs@6.5.099+ * deps: send@0.15.4100+ - deps: debug@2.6.8101+ - deps: depd@~1.1.1102+ - deps: http-errors@~1.6.2103+ * deps: serve-static@1.12.4104+ - deps: send@0.15.4105+106+4.15.3 / 2017-05-16107+===================108+109+ * Fix error when `res.set` cannot add charset to `Content-Type`110+ * deps: debug@2.6.7111+ - Fix `DEBUG_MAX_ARRAY_LENGTH`112+ - deps: ms@2.0.0113+ * deps: finalhandler@~1.0.3114+ - Fix missing `</html>` in HTML document115+ - deps: debug@2.6.7116+ * deps: proxy-addr@~1.1.4117+ - deps: ipaddr.js@1.3.0118+ * deps: send@0.15.3119+ - deps: debug@2.6.7120+ - deps: ms@2.0.0121+ * deps: serve-static@1.12.3122+ - deps: send@0.15.3123+ * deps: type-is@~1.6.15124+ - deps: mime-types@~2.1.15125+ * deps: vary@~1.1.1126+ - perf: hoist regular expression127+128 4.15.2 / 2017-03-06129 ===================130 131 * deps: qs@6.4.03244 unmodified linesmodified:package.json+21 added-19 removed
31 unmodified lines32 "content-disposition": "0.5.2",33 "content-type": "~1.0.2",34 "cookie": "0.3.1",35 "cookie-signature": "1.0.6",36- "debug": "2.6.1",37- "depd": "~1.1.0",36+ "debug": "2.6.8",37+ "depd": "~1.1.1",38 "encodeurl": "~1.0.1",39 "escape-html": "~1.0.3",40 "etag": "~1.8.0",41- "finalhandler": "~1.0.0",41+ "finalhandler": "~1.0.4",42 "fresh": "0.5.0",43 "merge-descriptors": "1.0.1",44 "methods": "~1.1.2",45 "on-finished": "~2.3.0",46 "parseurl": "~1.3.1",47 "path-is-absolute": "1.0.1",48 "path-to-regexp": "0.1.7",49- "proxy-addr": "~1.1.3",50- "qs": "6.4.0",49+ "proxy-addr": "~1.1.5",50+ "qs": "6.5.0",51 "range-parser": "~1.2.0",52- "router": "~1.3.0",53- "send": "0.15.1",54- "serve-static": "1.12.1",52+ "router": "~1.3.1",53+ "send": "0.15.4",54+ "serve-static": "1.12.4",55 "setprototypeof": "1.0.3",56 "statuses": "~1.3.1",57- "type-is": "~1.6.14",57+ "type-is": "~1.6.15",58 "utils-merge": "1.0.0",59- "vary": "~1.1.0"59+ "vary": "~1.1.1"60 },61 "devDependencies": {62 "after": "0.8.2",63- "body-parser": "1.17.1",63+ "body-parser": "1.17.2",64 "cookie-parser": "~1.4.3",65- "ejs": "2.5.6",66- "express-session": "1.15.1",65+ "cookie-session": "1.3.0",66+ "ejs": "2.5.7",67+ "eslint": "2.13.1",68+ "express-session": "1.15.5",69+ "hbs": "4.0.1",70 "istanbul": "0.4.5",71 "marked": "0.3.6",69- "method-override": "2.3.7",70- "mocha": "3.2.0",71- "morgan": "1.8.1",72+ "method-override": "2.3.9",73+ "mocha": "3.5.0",74+ "morgan": "1.8.2",75 "multiparty": "4.1.3",76 "pbkdf2-password": "1.2.1",74- "should": "11.2.0",77+ "should": "11.2.1",78 "supertest": "1.2.0",79 "connect-redis": "~2.4.1",77- "cookie-session": "~1.2.0",78- "jade": "~1.11.0",80 "vhost": "~3.0.2"81 },82 "engines": {83 "node": ">= 0.10.0"5 unmodified lines89 "index.js",90 "lib/"91 ],92 "scripts": {93+ "lint": "eslint .",94 "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",95 "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/",96 "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",97 "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"2 unmodified linesmodified:Readme.md+2 added-3 removed
37 unmodified lines38 ## Docs & Community39 40 * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)]41 * [#express](https://webchat.freenode.net/?channels=express) on freenode IRC42- * [Github Organization](https://github.com/expressjs) for Official Middleware & Modules42+ * [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules43 * Visit the [Wiki](https://github.com/expressjs/express/wiki)44 * [Google Group](https://groups.google.com/group/express-js) for discussion45 * [Gitter](https://gitter.im/expressjs/express) for support and discussion46- * [Русскоязычная документация](http://jsman.ru/express/)46 47 **PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x).48 50-###Security Issues49+### Security Issues50 51 If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).52 53 ## Quick Start88 unmodified lines