Skip to content

Commit

Permalink
Merge tag '4.17.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 17, 2022
2 parents 6faf26d + 3d7fce5 commit 318fd4b
Show file tree
Hide file tree
Showing 123 changed files with 807 additions and 309 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ jobs:
include:
- name: Node.js 4.0
node-version: "4.0"
npm-i: mocha@5.2.0 supertest@3.4.2
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2

- name: Node.js 4.x
node-version: "4.9"
npm-i: mocha@5.2.0 supertest@3.4.2
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2

- name: Node.js 5.x
node-version: "5.12"
npm-i: mocha@5.2.0 supertest@3.4.2
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2

- name: Node.js 6.x
node-version: "6.17"
npm-i: mocha@6.2.2
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6

- name: Node.js 7.x
node-version: "7.10"
npm-i: mocha@6.2.2
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6

- name: Node.js 8.x
node-version: "8.17"
Expand All @@ -68,7 +68,7 @@ jobs:
node-version: "13.14"

- name: Node.js 14.x
node-version: "14.18"
node-version: "14.19"

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -113,6 +113,7 @@ jobs:
echo "node@$(node -v)"
echo "npm@$(npm -v)"
npm -s ls ||:
(npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }'
- name: Run tests
shell: bash
Expand Down
20 changes: 4 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
# OS X
.DS_Store*
Icon?
._*

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini

# Linux
.directory
*~


# npm
node_modules
package-lock.json
*.log
*.gz


# Coveralls
.nyc_output
coverage

# Benchmarking
benchmarks/graphs

# ignore additional files using core.excludesFile
# https://git-scm.com/docs/gitignore
20 changes: 20 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
5.x
===

This incorporates all changes after 4.17.2 up to 4.17.3.

5.0.0-beta.1 / 2022-02-14
=========================

Expand Down Expand Up @@ -157,6 +162,21 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
* add:
- `app.router` is a reference to the base router

4.17.3 / 2022-02-16
===================

* deps: accepts@~1.3.8
- deps: mime-types@~2.1.34
- deps: negotiator@0.6.3
* deps: body-parser@1.19.2
- deps: bytes@3.1.2
- deps: qs@6.9.7
- deps: raw-body@2.4.3
* deps: cookie@0.4.2
* deps: qs@6.9.7
* Fix handling of `__proto__` keys
* pref: remove unnecessary regexp for trust proxy

4.17.2 / 2021-12-16
===================

Expand Down
16 changes: 15 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
- nodejs_version: "11.15"
- nodejs_version: "12.22"
- nodejs_version: "13.14"
- nodejs_version: "14.18"
- nodejs_version: "14.19"
cache:
- node_modules
install:
Expand Down Expand Up @@ -46,11 +46,25 @@ install:
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 12) {
npm install --silent --save-dev mocha@8.4.0
}
- ps: |
# nyc for test coverage
# - use 10.3.2 for Node.js < 4
# - use 11.9.0 for Node.js < 6
# - use 14.1.1 for Node.js < 8
if ([int]$env:nodejs_version.split(".")[0] -lt 4) {
npm install --silent --save-dev nyc@10.3.2
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) {
npm install --silent --save-dev nyc@11.9.0
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 8) {
npm install --silent --save-dev nyc@14.1.1
}
- ps: |
# supertest for http calls
# - use 3.4.2 for Node.js < 6
if ([int]$env:nodejs_version.split(".")[0] -lt 6) {
npm install --silent --save-dev supertest@3.4.2
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 8) {
npm install --silent --save-dev supertest@6.1.6
}
# Update Node.js modules
- ps: |
Expand Down
9 changes: 6 additions & 3 deletions examples/auth/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down Expand Up @@ -59,14 +61,14 @@ function authenticate(name, pass, fn) {
if (!module.parent) console.log('authenticating %s:%s', name, pass);
var user = users[name];
// query the db for the given username
if (!user) return fn(new Error('cannot find user'));
if (!user) return fn(null, null)
// apply the same algorithm to the POSTed password, applying
// the hash against the pass / salt, if there is a match we
// found the user
hash({ password: pass, salt: user.salt }, function (err, pass, salt, hash) {
if (err) return fn(err);
if (hash === user.hash) return fn(null, user)
fn(new Error('invalid password'));
fn(null, null)
});
}

Expand Down Expand Up @@ -99,9 +101,10 @@ app.get('/login', function(req, res){
res.render('login');
});

app.post('/login', function(req, res){
app.post('/login', function (req, res, next) {
if (!req.body) return res.sendStatus(400)
authenticate(req.body.username, req.body.password, function(err, user){
if (err) return next(err)
if (user) {
// Regenerate session when signing in
// to prevent fixation
Expand Down
2 changes: 2 additions & 0 deletions examples/content-negotiation/db.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

var users = [];

users.push({ name: 'Tobi' });
Expand Down
2 changes: 2 additions & 0 deletions examples/content-negotiation/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

var express = require('../../');
var app = module.exports = express();
var users = require('./db');
Expand Down
1 change: 1 addition & 0 deletions examples/content-negotiation/users.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict'

var users = require('./db');

Expand Down
2 changes: 2 additions & 0 deletions examples/cookie-sessions/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/cookies/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
9 changes: 8 additions & 1 deletion examples/downloads/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
'use strict'

/**
* Module dependencies.
*/

var express = require('../../');
var path = require('path');
var resolvePath = require('resolve-path')

var app = module.exports = express();

// path to where the files are stored on disk
var FILES_DIR = path.join(__dirname, 'files')

app.get('/', function(req, res){
res.send('<ul>' +
'<li>Download <a href="/files/notes/groceries.txt">notes/groceries.txt</a>.</li>' +
Expand All @@ -18,7 +25,7 @@ app.get('/', function(req, res){
// /files/* is accessed via req.params[0]
// but here we name it :file
app.get('/files/:file+', function (req, res, next) {
var filePath = path.join(__dirname, 'files', req.params.file);
var filePath = resolvePath(FILES_DIR, req.params.file)

res.download(filePath, function (err) {
if (!err) return; // file sent
Expand Down
2 changes: 2 additions & 0 deletions examples/ejs/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/error-pages/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/error/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
4 changes: 3 additions & 1 deletion examples/hello-world/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict'

var express = require('../../');

var app = express();
var app = module.exports = express()

app.get('/', function(req, res){
res.send('Hello World');
Expand Down
2 changes: 2 additions & 0 deletions examples/markdown/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/multi-router/controllers/api_v1.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

var express = require('../../..');

var apiv1 = express.Router();
Expand Down
2 changes: 2 additions & 0 deletions examples/multi-router/controllers/api_v2.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

var express = require('../../..');

var apiv2 = express.Router();
Expand Down
2 changes: 2 additions & 0 deletions examples/multi-router/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

var express = require('../..');

var app = module.exports = express();
Expand Down
2 changes: 2 additions & 0 deletions examples/multipart/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/mvc/controllers/main/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

exports.index = function(req, res){
res.redirect('/users');
};
2 changes: 2 additions & 0 deletions examples/mvc/controllers/pet/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/mvc/controllers/user-pet/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/mvc/controllers/user/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/mvc/db.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

// faux database

var pets = exports.pets = [];
Expand Down
2 changes: 2 additions & 0 deletions examples/mvc/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/mvc/lib/boot.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
1 change: 1 addition & 0 deletions examples/online/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict'

// install redis first:
// https://redis.io/
Expand Down
2 changes: 2 additions & 0 deletions examples/params/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/resource/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/route-map/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/route-middleware/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/route-separation/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/**
* Module dependencies.
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/route-separation/post.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

// Fake posts database

var posts = [
Expand Down
2 changes: 2 additions & 0 deletions examples/route-separation/site.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

exports.index = function(req, res){
res.render('index', { title: 'Route Separation Example' });
};
2 changes: 2 additions & 0 deletions examples/route-separation/user.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

// Fake user database

var users = [
Expand Down
1 change: 1 addition & 0 deletions examples/search/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict'

// install redis first:
// https://redis.io/
Expand Down
2 changes: 2 additions & 0 deletions examples/search/public/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

var search = document.querySelector('[type=search]');
var code = document.querySelector('pre');

Expand Down
Loading

0 comments on commit 318fd4b

Please sign in to comment.