Skip to content

Commit fa4542d

Browse files
committed
Merge tag '4.17.1'
2 parents 5f0c829 + e1b45eb commit fa4542d

38 files changed

+3319
-84
lines changed

.travis.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ node_js:
77
- "3.3"
88
- "4.9"
99
- "5.12"
10-
- "6.14"
10+
- "6.17"
1111
- "7.10"
12-
- "8.12"
12+
- "8.16"
13+
- "9.11"
14+
- "10.15"
15+
- "11.15"
16+
- "12.3"
1317
matrix:
1418
include:
15-
- node_js: "9"
16-
env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
17-
- node_js: "10"
19+
- node_js: "13"
1820
env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
1921
allow_failures:
2022
# Allow the nightly installs to fail
@@ -60,5 +62,5 @@ script:
6062
after_script:
6163
- |
6264
# Upload coverage to coveralls
63-
npm install --save-dev coveralls@2.10.0
65+
npm install --save-dev coveralls@2.12.0
6466
coveralls < ./coverage/lcov.info

Contributing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ expertise to resolve rare disputes.
1919

2020
Log an issue for any question or problem you might have. When in doubt, log an issue, and
2121
any additional policies about what to include will be provided in the responses. The only
22-
exception is security dislosures which should be sent privately.
22+
exception is security disclosures which should be sent privately.
2323

2424
Committers may direct you to another repository, ask for additional clarifications, and
2525
add appropriate metadata before the issue is addressed.

History.md

+71-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
5.x
2+
===
3+
4+
This incorporates all changes after 4.16.4 up to 4.17.1.
5+
16
5.0.0-alpha.7 / 2018-10-26
27
==========================
38

@@ -113,6 +118,63 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
113118
* add:
114119
- `app.router` is a reference to the base router
115120

121+
4.17.1 / 2019-05-25
122+
===================
123+
124+
* Revert "Improve error message for `null`/`undefined` to `res.status`"
125+
126+
4.17.0 / 2019-05-16
127+
===================
128+
129+
* Add `express.raw` to parse bodies into `Buffer`
130+
* Add `express.text` to parse bodies into string
131+
* Improve error message for non-strings to `res.sendFile`
132+
* Improve error message for `null`/`undefined` to `res.status`
133+
* Support multiple hosts in `X-Forwarded-Host`
134+
* deps: accepts@~1.3.7
135+
136+
- Add encoding MIK
137+
- Add petabyte (`pb`) support
138+
- Fix parsing array brackets after index
139+
140+
141+
142+
143+
144+
- deps: type-is@~1.6.17
145+
146+
147+
- Add `SameSite=None` support
148+
* deps: finalhandler@~1.1.2
149+
- Set stricter `Content-Security-Policy` header
150+
- deps: parseurl@~1.3.3
151+
- deps: statuses@~1.5.0
152+
* deps: parseurl@~1.3.3
153+
* deps: proxy-addr@~2.0.5
154+
155+
156+
- Fix parsing array brackets after index
157+
* deps: range-parser@~1.2.1
158+
159+
- Set stricter CSP header in redirect & error responses
160+
- deps: http-errors@~1.7.2
161+
162+
163+
- deps: range-parser@~1.2.1
164+
- deps: statuses@~1.5.0
165+
- perf: remove redundant `path.normalize` call
166+
167+
- Set stricter CSP header in redirect response
168+
- deps: parseurl@~1.3.3
169+
170+
171+
* deps: statuses@~1.5.0
172+
- Add `103 Early Hints`
173+
* deps: type-is@~1.6.18
174+
- deps: mime-types@~2.1.24
175+
- perf: prevent internal `throw` on invalid type
176+
>>>>>>> 4.17.1
177+
116178
4.16.4 / 2018-10-10
117179
===================
118180

@@ -409,7 +471,7 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
409471
- Fix including type extensions in parameters in `Accept` parsing
410472
- Fix parsing `Accept` parameters with quoted equals
411473
- Fix parsing `Accept` parameters with quoted semicolons
412-
- Many performance improvments
474+
- Many performance improvements
413475
- deps: mime-types@~2.1.11
414476
415477
* deps: content-type@~1.0.2
@@ -424,7 +486,7 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
424486
- perf: enable strict mode
425487
- perf: hoist regular expression
426488
- perf: use for loop in parse
427-
- perf: use string concatination for serialization
489+
- perf: use string concatenation for serialization
428490
429491
- Change invalid or non-numeric status code to 500
430492
- Overwrite status message to match set status code
@@ -434,7 +496,7 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
434496
* deps: proxy-addr@~1.1.2
435497
- Fix accepting various invalid netmasks
436498
- Fix IPv6-mapped IPv4 validation edge cases
437-
- IPv4 netmasks must be contingous
499+
- IPv4 netmasks must be contiguous
438500
- IPv6 addresses cannot be used as a netmask
439501
440502
@@ -1212,13 +1274,13 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
12121274
12131275
12141276
1215-
- Do not throw un-catchable error on file open race condition
1277+
- Do not throw uncatchable error on file open race condition
12161278
- Use `escape-html` for HTML escaping
12171279
12181280
12191281
12201282
1221-
- Do not throw un-catchable error on file open race condition
1283+
- Do not throw uncatchable error on file open race condition
12221284
12231285

12241286
4.4.2 / 2014-06-09
@@ -2098,7 +2160,7 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
20982160
20992161
21002162
2101-
- Do not throw un-catchable error on file open race condition
2163+
- Do not throw uncatchable error on file open race condition
21022164
- Use `escape-html` for HTML escaping
21032165
21042166
@@ -3283,7 +3345,7 @@ Shaw]
32833345
* Updated haml submodule
32843346
* Changed ETag; removed inode, modified time only
32853347
* Fixed LF to CRLF for setting multiple cookies
3286-
* Fixed cookie complation; values are now urlencoded
3348+
* Fixed cookie compilation; values are now urlencoded
32873349
* Fixed cookies parsing; accepts quoted values and url escaped cookies
32883350

32893351
0.11.0 / 2010-05-06
@@ -3478,7 +3540,7 @@ Shaw]
34783540

34793541
* Added "plot" format option for Profiler (for gnuplot processing)
34803542
* Added request number to Profiler plugin
3481-
* Fixed binary encoding for multi-part file uploads, was previously defaulting to UTF8
3543+
* Fixed binary encoding for multipart file uploads, was previously defaulting to UTF8
34823544
* Fixed issue with routes not firing when not files are present. Closes #184
34833545
* Fixed process.Promise -> events.Promise
34843546

@@ -3524,7 +3586,7 @@ Shaw]
35243586
* Updated sample chat app to show messages on load
35253587
* Updated libxmljs parseString -> parseHtmlString
35263588
* Fixed `make init` to work with older versions of git
3527-
* Fixed specs can now run independent specs for those who cant build deps. Closes #127
3589+
* Fixed specs can now run independent specs for those who can't build deps. Closes #127
35283590
* Fixed issues introduced by the node url module changes. Closes 126.
35293591
* Fixed two assertions failing due to Collection#keys() returning strings
35303592
* Fixed faulty Collection#toArray() spec due to keys() returning strings

Readme.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
[![Test Coverage][coveralls-image]][coveralls-url]
1010

1111
```js
12-
var express = require('express')
13-
var app = express()
12+
const express = require('express')
13+
const app = express()
1414

1515
app.get('/', function (req, res) {
1616
res.send('Hello World')
@@ -90,6 +90,8 @@ $ npm install
9090
$ npm start
9191
```
9292

93+
View the website at: http://localhost:3000
94+
9395
## Philosophy
9496

9597
The Express philosophy is to provide small, robust tooling for HTTP servers, making
@@ -125,6 +127,10 @@ $ npm install
125127
$ npm test
126128
```
127129

130+
## Contributing
131+
132+
[Contributing Guide](Contributing.md)
133+
128134
## People
129135

130136
The original author of Express is [TJ Holowaychuk](https://github.com/tj)
@@ -147,7 +153,3 @@ The current lead maintainer is [Douglas Christopher Wilson](https://github.com/d
147153
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
148154
[coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg
149155
[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master
150-
[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg
151-
[gratipay-url-visionmedia]: https://gratipay.com/visionmedia/
152-
[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg
153-
[gratipay-url-dougwilson]: https://gratipay.com/dougwilson/

appveyor.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ environment:
77
- nodejs_version: "3.3"
88
- nodejs_version: "4.9"
99
- nodejs_version: "5.12"
10-
- nodejs_version: "6.14"
10+
- nodejs_version: "6.17"
1111
- nodejs_version: "7.10"
12-
- nodejs_version: "8.12"
12+
- nodejs_version: "8.16"
13+
- nodejs_version: "9.11"
14+
- nodejs_version: "10.15"
15+
- nodejs_version: "11.15"
16+
- nodejs_version: "12.3"
1317
cache:
1418
- node_modules
1519
install:

examples/downloads/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ app.get('/files/:file(*)', function(req, res, next){
2121

2222
res.download(filePath, function (err) {
2323
if (!err) return; // file sent
24-
if (err && err.status !== 404) return next(err); // non-404 error
24+
if (err.status !== 404) return next(err); // non-404 error
2525
// file for download not found
2626
res.statusCode = 404;
2727
res.send('Cant find that file, sorry!');

examples/mvc/public/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
body {
22
padding: 50px;
3-
font: 16px "Helvetica Neue", Helvetica, Arial;
3+
font: 16px "Helvetica Neue", Helvetica, Arial, sans-serif;
44
}
55
a {
66
color: #107aff;
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
foo
1+
// foo

lib/express.js

+2
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,7 @@ exports.Router = Router;
7575
*/
7676

7777
exports.json = bodyParser.json
78+
exports.raw = bodyParser.raw
7879
exports.static = require('serve-static');
80+
exports.text = bodyParser.text
7981
exports.urlencoded = bodyParser.urlencoded

lib/request.js

+4
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ defineGetter(req, 'host', function host(){
409409

410410
if (!val || !trust(this.connection.remoteAddress, 0)) {
411411
val = this.get('Host');
412+
} else if (val.indexOf(',') !== -1) {
413+
// Note: X-Forwarded-Host is normally only ever a
414+
// single value, but this is to be safe.
415+
val = val.substring(0, val.indexOf(',')).trimRight()
412416
}
413417

414418
return val || undefined;

lib/response.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ res.sendFile = function sendFile(path, options, callback) {
355355
throw new TypeError('path argument is required to res.sendFile');
356356
}
357357

358+
if (typeof path !== 'string') {
359+
throw new TypeError('path must be a string to res.sendFile')
360+
}
361+
358362
// support function as second arg
359363
if (typeof options === 'function') {
360364
done = options;
@@ -686,7 +690,7 @@ res.clearCookie = function clearCookie(name, options) {
686690
* // "Remember Me" for 15 minutes
687691
* res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });
688692
*
689-
* // save as above
693+
* // same as above
690694
* res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })
691695
*
692696
* @param {String} name
@@ -988,6 +992,7 @@ function stringify (value, replacer, spaces, escape) {
988992
return '\\u003e'
989993
case 0x26:
990994
return '\\u0026'
995+
/* istanbul ignore next: unreachable default */
991996
default:
992997
return c
993998
}

package.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -27,49 +27,49 @@
2727
"api"
2828
],
2929
"dependencies": {
30-
"accepts": "~1.3.5",
30+
"accepts": "~1.3.7",
3131
"array-flatten": "2.1.1",
32-
"body-parser": "1.18.3",
33-
"content-disposition": "0.5.2",
32+
"body-parser": "1.19.0",
33+
"content-disposition": "0.5.3",
3434
"content-type": "~1.0.4",
35-
"cookie": "0.3.1",
35+
"cookie": "0.4.0",
3636
"cookie-signature": "1.0.6",
3737
"debug": "3.1.0",
3838
"depd": "~1.1.2",
3939
"encodeurl": "~1.0.2",
4040
"escape-html": "~1.0.3",
4141
"etag": "~1.8.1",
42-
"finalhandler": "1.1.1",
42+
"finalhandler": "~1.1.2",
4343
"fresh": "0.5.2",
4444
"merge-descriptors": "1.0.1",
4545
"methods": "~1.1.2",
4646
"on-finished": "~2.3.0",
47-
"parseurl": "~1.3.2",
47+
"parseurl": "~1.3.3",
4848
"path-is-absolute": "1.0.1",
49-
"proxy-addr": "~2.0.4",
50-
"qs": "6.5.2",
51-
"range-parser": "~1.2.0",
49+
"proxy-addr": "~2.0.5",
50+
"qs": "6.7.0",
51+
"range-parser": "~1.2.1",
5252
"router": "2.0.0-alpha.1",
5353
"safe-buffer": "5.1.2",
54-
"send": "0.16.2",
55-
"serve-static": "1.13.2",
56-
"setprototypeof": "1.1.0",
57-
"statuses": "~1.4.0",
58-
"type-is": "~1.6.16",
54+
"send": "0.17.1",
55+
"serve-static": "1.14.1",
56+
"setprototypeof": "1.1.1",
57+
"statuses": "~1.5.0",
58+
"type-is": "~1.6.18",
5959
"utils-merge": "1.0.1",
6060
"vary": "~1.1.2"
6161
},
6262
"devDependencies": {
6363
"after": "0.8.2",
64-
"connect-redis": "3.4.0",
65-
"cookie-parser": "~1.4.3",
66-
"cookie-session": "1.3.2",
64+
"connect-redis": "3.4.1",
65+
"cookie-parser": "~1.4.4",
66+
"cookie-session": "1.3.3",
6767
"ejs": "2.6.1",
6868
"eslint": "2.13.1",
69-
"express-session": "1.15.6",
70-
"hbs": "4.0.1",
69+
"express-session": "1.16.1",
70+
"hbs": "4.0.4",
7171
"istanbul": "0.4.5",
72-
"marked": "0.5.1",
72+
"marked": "0.6.2",
7373
"method-override": "3.0.0",
7474
"mocha": "5.2.0",
7575
"morgan": "1.9.1",

0 commit comments

Comments
 (0)