Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.16 #3423

Merged
merged 26 commits into from
Sep 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
94fdb67
build: support Node.js 8.x
dougwilson Sep 26, 2017
c3fb7e5
build: test against Node.js 9.x nightly
dougwilson Sep 26, 2017
80f1ea9
Improve error message when autoloading invalid view engine
dougwilson Sep 26, 2017
48940e6
Skip Buffer encoding when not generating ETag for small response
dougwilson Sep 26, 2017
550043c
deps: [email protected]
dougwilson Sep 26, 2017
9a99c15
deps: accepts@~1.3.4
dougwilson Sep 28, 2017
70589c3
deps: content-type@~1.0.4
dougwilson Sep 28, 2017
e62bb8b
deps: etag@~1.8.1
dougwilson Sep 28, 2017
ad7d96d
deps: [email protected]
dougwilson Sep 28, 2017
5cc761c
deps: parseurl@~1.3.2
dougwilson Sep 28, 2017
673d51f
deps: [email protected]
dougwilson Sep 28, 2017
c2f4fb5
deps: [email protected]
dougwilson Sep 28, 2017
02a9d5f
deps: proxy-addr@~2.0.2
dougwilson Sep 28, 2017
d9d09b8
perf: re-use options object when generating ETags
lpage May 18, 2017
fa272ed
docs: fix typo in jsdoc comment
shime Sep 27, 2017
12c3712
Use safe-buffer for improved Buffer API
dougwilson Sep 28, 2017
2df1ad2
Improve error messages when non-function provided as middleware
shime Sep 26, 2017
44591fe
deps: vary@~1.1.2
chainhelen Sep 28, 2017
95fb5cc
perf: remove dead .charset set in res.jsonp
dougwilson Sep 28, 2017
a24fd0c
Add options to res.download
chillypepper Jul 20, 2017
628438d
deps: update example dependencies
dougwilson Sep 28, 2017
7154014
Add "escape json" setting for res.json and res.jsonp
Apr 5, 2017
ddeb713
tests: add maxAge option tests for res.sendFile
dougwilson Sep 28, 2017
4196458
deps: [email protected]
danez Sep 28, 2017
86f5df0
deps: [email protected]
dougwilson Sep 28, 2017
c0136d8
Add express.json and express.urlencoded to parse bodies
dougwilson Sep 28, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Desktop.ini

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

Expand Down
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ node_js:
- "5.12"
- "6.11"
- "7.10"
- "8.4"
matrix:
include:
- node_js: "8"
env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
- node_js: "9"
env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
allow_failures:
# Allow the nightly installs to fail
- env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
Expand All @@ -21,6 +24,9 @@ cache:
directories:
- node_modules
before_install:
# Skip updating shrinkwrap / lock
- "npm config set shrinkwrap false"

# Remove all non-test dependencies
- "npm rm --save-dev connect-redis"

Expand Down
48 changes: 48 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
unreleased
==========

* Add `"json escape"` setting for `res.json` and `res.jsonp`
* Add `express.json` and `express.urlencoded` to parse bodies
* Improve error message when autoloading invalid view engine
* Improve error messages when non-function provided as middleware
* Skip `Buffer` encoding when not generating ETag for small response
* Use `safe-buffer` for improved Buffer API
* deps: accepts@~1.3.4
- deps: mime-types@~2.1.16
* deps: content-type@~1.0.4
- perf: remove argument reassignment
- perf: skip parameter parsing when no parameters
* deps: etag@~1.8.1
- perf: replace regular expression with substring
* deps: [email protected]
- Use `res.headersSent` when available
* deps: parseurl@~1.3.2
- perf: reduce overhead for full URLs
- perf: unroll the "fast-path" `RegExp`
* deps: proxy-addr@~2.0.2
- Fix trimming leading / trailing OWS in `X-Forwarded-For`
- deps: forwarded@~0.1.2
- deps: [email protected]
- perf: reduce overhead when no `X-Forwarded-For` header
* deps: [email protected]
- Fix parsing & compacting very deep objects
* deps: [email protected]
- Add 70 new types for file extensions
- Add `immutable` option
- Fix missing `</html>` in default error & redirects
- Set charset as "UTF-8" for .js and .json
- Use instance methods on steam to check for listeners
- deps: [email protected]
- perf: improve path validation speed
* deps: [email protected]
- Add 70 new types for file extensions
- Add `immutable` option
- Set charset as "UTF-8" for .js and .json
- deps: [email protected]
* deps: [email protected]
* deps: [email protected]
* deps: vary@~1.1.2
- perf: improve header token parsing speed
* perf: re-use options object when generating ETags
* perf: remove dead `.charset` set in `res.jsonp`

4.15.5 / 2017-09-24
===================

Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ environment:
- nodejs_version: "5.12"
- nodejs_version: "6.11"
- nodejs_version: "7.10"
- nodejs_version: "8.4"
cache:
- node_modules
install:
- ps: Install-Product node $env:nodejs_version
- npm config set shrinkwrap false
- npm rm --save-dev connect-redis
- if exist node_modules npm prune
- if exist node_modules npm rebuild
Expand Down
4 changes: 1 addition & 3 deletions benchmarks/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ while (n--) {
});
}

var body = new Buffer('Hello World');

app.use(function(req, res, next){
res.send(body);
res.send('Hello World')
});

app.listen(3333);
3 changes: 1 addition & 2 deletions examples/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

var express = require('../..');
var bodyParser = require('body-parser');
var hash = require('pbkdf2-password')()
var path = require('path');
var session = require('express-session');
Expand All @@ -17,7 +16,7 @@ app.set('views', path.join(__dirname, 'views'));

// middleware

app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.urlencoded({ extended: false }))
app.use(session({
resave: false, // don't save session if unmodified
saveUninitialized: false, // don't create session until something stored
Expand Down
3 changes: 1 addition & 2 deletions examples/cookies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var express = require('../../');
var app = module.exports = express();
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');

// custom log format
if ('test' != process.env.NODE_ENV) app.use(logger(':method :url'));
Expand All @@ -18,7 +17,7 @@ if ('test' != process.env.NODE_ENV) app.use(logger(':method :url'));
app.use(cookieParser('my secret here'));

// parses x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.urlencoded({ extended: false }))

app.get('/', function(req, res){
if (req.cookies.remember) {
Expand Down
3 changes: 1 addition & 2 deletions examples/mvc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var express = require('../..');
var logger = require('morgan');
var path = require('path');
var session = require('express-session');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');

var app = module.exports = express();
Expand Down Expand Up @@ -43,7 +42,7 @@ app.use(session({
}));

// parse request bodies (req.body)
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.urlencoded({ extended: true }))

// allow overriding methods in query (?_method=put)
app.use(methodOverride('_method'));
Expand Down
3 changes: 1 addition & 2 deletions examples/route-separation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var path = require('path');
var app = express();
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var site = require('./site');
var post = require('./post');
Expand All @@ -27,7 +26,7 @@ if (!module.parent) {

app.use(methodOverride('_method'));
app.use(cookieParser());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.urlencoded({ extended: true }))
app.use(express.static(path.join(__dirname, 'public')));

// General
Expand Down
4 changes: 2 additions & 2 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ app.use = function use(fn) {
var fns = flatten(slice.call(arguments, offset));

if (fns.length === 0) {
throw new TypeError('app.use() requires middleware functions');
throw new TypeError('app.use() requires a middleware function')
}

// setup router
Expand Down Expand Up @@ -338,7 +338,7 @@ app.param = function param(name, fn) {
* Assign `setting` to `val`, or return `setting`'s value.
*
* app.set('foo', 'bar');
* app.get('foo');
* app.set('foo');
* // => "bar"
*
* Mounted servers inherit their parent server's settings.
Expand Down
7 changes: 4 additions & 3 deletions lib/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Module dependencies.
*/

var bodyParser = require('body-parser')
var EventEmitter = require('events').EventEmitter;
var mixin = require('merge-descriptors');
var proto = require('./application');
Expand Down Expand Up @@ -74,16 +75,16 @@ exports.Router = Router;
* Expose middleware
*/

exports.json = bodyParser.json
exports.query = require('./middleware/query');
exports.static = require('serve-static');
exports.urlencoded = bodyParser.urlencoded

/**
* Replace removed middleware with an appropriate error message.
*/

[
'json',
'urlencoded',
;[
'bodyParser',
'compress',
'cookieSession',
Expand Down
Loading