Skip to content

Commit 121fe99

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

38 files changed

+3318
-84
lines changed

.travis.yml

Lines changed: 8 additions & 6 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 70 additions & 9 deletions
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,62 @@ 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+
116177
4.16.4 / 2018-10-10
117178
===================
118179

@@ -409,7 +470,7 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
409470
- Fix including type extensions in parameters in `Accept` parsing
410471
- Fix parsing `Accept` parameters with quoted equals
411472
- Fix parsing `Accept` parameters with quoted semicolons
412-
- Many performance improvments
473+
- Many performance improvements
413474
- deps: mime-types@~2.1.11
414475
415476
* deps: content-type@~1.0.2
@@ -424,7 +485,7 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
424485
- perf: enable strict mode
425486
- perf: hoist regular expression
426487
- perf: use for loop in parse
427-
- perf: use string concatination for serialization
488+
- perf: use string concatenation for serialization
428489
429490
- Change invalid or non-numeric status code to 500
430491
- Overwrite status message to match set status code
@@ -434,7 +495,7 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
434495
* deps: proxy-addr@~1.1.2
435496
- Fix accepting various invalid netmasks
436497
- Fix IPv6-mapped IPv4 validation edge cases
437-
- IPv4 netmasks must be contingous
498+
- IPv4 netmasks must be contiguous
438499
- IPv6 addresses cannot be used as a netmask
439500
440501
@@ -1212,13 +1273,13 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
12121273
12131274
12141275
1215-
- Do not throw un-catchable error on file open race condition
1276+
- Do not throw uncatchable error on file open race condition
12161277
- Use `escape-html` for HTML escaping
12171278
12181279
12191280
12201281
1221-
- Do not throw un-catchable error on file open race condition
1282+
- Do not throw uncatchable error on file open race condition
12221283
12231284

12241285
4.4.2 / 2014-06-09
@@ -2098,7 +2159,7 @@ This is the first Express 5.0 alpha release, based off 4.10.1.
20982159
20992160
21002161
2101-
- Do not throw un-catchable error on file open race condition
2162+
- Do not throw uncatchable error on file open race condition
21022163
- Use `escape-html` for HTML escaping
21032164
21042165
@@ -3283,7 +3344,7 @@ Shaw]
32833344
* Updated haml submodule
32843345
* Changed ETag; removed inode, modified time only
32853346
* Fixed LF to CRLF for setting multiple cookies
3286-
* Fixed cookie complation; values are now urlencoded
3347+
* Fixed cookie compilation; values are now urlencoded
32873348
* Fixed cookies parsing; accepts quoted values and url escaped cookies
32883349

32893350
0.11.0 / 2010-05-06
@@ -3478,7 +3539,7 @@ Shaw]
34783539

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

@@ -3524,7 +3585,7 @@ Shaw]
35243585
* Updated sample chat app to show messages on load
35253586
* Updated libxmljs parseString -> parseHtmlString
35263587
* 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
3588+
* Fixed specs can now run independent specs for those who can't build deps. Closes #127
35283589
* Fixed issues introduced by the node url module changes. Closes 126.
35293590
* Fixed two assertions failing due to Collection#keys() returning strings
35303591
* Fixed faulty Collection#toArray() spec due to keys() returning strings

Readme.md

Lines changed: 8 additions & 6 deletions
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

Lines changed: 6 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
foo
1+
// foo

lib/express.js

Lines changed: 2 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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;

0 commit comments

Comments
 (0)