step-node-agent 3.25.4 → 3.25.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/node_modules/aws4/aws4.js +1 -1
  2. package/node_modules/aws4/package.json +2 -2
  3. package/node_modules/body-parser/HISTORY.md +7 -0
  4. package/node_modules/body-parser/README.md +11 -0
  5. package/node_modules/body-parser/lib/types/urlencoded.js +30 -7
  6. package/node_modules/body-parser/package.json +2 -2
  7. package/node_modules/encodeurl/README.md +19 -38
  8. package/node_modules/encodeurl/index.js +1 -1
  9. package/node_modules/encodeurl/package.json +7 -7
  10. package/node_modules/express/History.md +27 -0
  11. package/node_modules/express/Readme.md +100 -6
  12. package/node_modules/express/lib/response.js +11 -10
  13. package/node_modules/express/package.json +11 -11
  14. package/node_modules/finalhandler/HISTORY.md +15 -0
  15. package/node_modules/finalhandler/README.md +2 -2
  16. package/node_modules/finalhandler/index.js +7 -2
  17. package/node_modules/finalhandler/package.json +8 -7
  18. package/node_modules/is-core-module/CHANGELOG.md +10 -0
  19. package/node_modules/is-core-module/core.json +2 -2
  20. package/node_modules/is-core-module/package.json +4 -4
  21. package/node_modules/is-core-module/test/index.js +17 -1
  22. package/node_modules/merge-descriptors/README.md +4 -3
  23. package/node_modules/merge-descriptors/index.js +3 -3
  24. package/node_modules/merge-descriptors/package.json +14 -7
  25. package/node_modules/path-to-regexp/index.js +57 -40
  26. package/node_modules/path-to-regexp/package.json +2 -2
  27. package/node_modules/qs/.editorconfig +3 -0
  28. package/node_modules/qs/.eslintrc +2 -2
  29. package/node_modules/qs/CHANGELOG.md +59 -5
  30. package/node_modules/qs/README.md +133 -49
  31. package/node_modules/qs/dist/qs.js +56 -2020
  32. package/node_modules/qs/lib/parse.js +46 -13
  33. package/node_modules/qs/lib/stringify.js +53 -28
  34. package/node_modules/qs/lib/utils.js +47 -34
  35. package/node_modules/qs/package.json +26 -12
  36. package/node_modules/qs/test/empty-keys-cases.js +267 -0
  37. package/node_modules/qs/test/parse.js +347 -32
  38. package/node_modules/qs/test/stringify.js +436 -47
  39. package/node_modules/send/HISTORY.md +5 -0
  40. package/node_modules/send/index.js +1 -2
  41. package/node_modules/send/node_modules/encodeurl/LICENSE +22 -0
  42. package/node_modules/send/node_modules/encodeurl/README.md +128 -0
  43. package/node_modules/send/node_modules/encodeurl/index.js +60 -0
  44. package/node_modules/send/node_modules/encodeurl/package.json +40 -0
  45. package/node_modules/send/package.json +1 -1
  46. package/node_modules/serve-static/HISTORY.md +16 -0
  47. package/node_modules/serve-static/index.js +1 -2
  48. package/node_modules/serve-static/package.json +3 -3
  49. package/package.json +1 -1
  50. package/node_modules/path-to-regexp/History.md +0 -36
  51. /package/node_modules/{encodeurl → send/node_modules/encodeurl}/HISTORY.md +0 -0
@@ -78,7 +78,7 @@ function RequestSigner(request, credentials) {
78
78
  }
79
79
 
80
80
  RequestSigner.prototype.matchHost = function(host) {
81
- var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/)
81
+ var match = (host || '').match(/([^\.]{1,63})\.(?:([^\.]{0,63})\.)?amazonaws\.com(\.cn)?$/)
82
82
  var hostParts = (match || []).slice(1, 3)
83
83
 
84
84
  // ES's hostParts are sometimes the other way round, if the value that is expected
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws4",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "Signs and prepares requests using AWS Signature Version 4",
5
5
  "author": "Michael Hart <michael.hart.au@gmail.com> (https://github.com/mhart)",
6
6
  "license": "MIT",
@@ -15,7 +15,7 @@
15
15
  "integration": "node ./test/slow.js"
16
16
  },
17
17
  "devDependencies": {
18
- "mocha": "^10.7.0",
18
+ "mocha": "^10.7.3",
19
19
  "should": "^13.2.3"
20
20
  }
21
21
  }
@@ -1,3 +1,10 @@
1
+ 1.20.3 / 2024-09-10
2
+ ===================
3
+
4
+ * deps: qs@6.13.0
5
+ * add `depth` option to customize the depth level in the parser
6
+ * IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`)
7
+
1
8
  1.20.2 / 2023-02-21
2
9
  ===================
3
10
 
@@ -4,6 +4,7 @@
4
4
  [![NPM Downloads][npm-downloads-image]][npm-url]
5
5
  [![Build Status][ci-image]][ci-url]
6
6
  [![Test Coverage][coveralls-image]][coveralls-url]
7
+ [![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
7
8
 
8
9
  Node.js body parsing middleware.
9
10
 
@@ -277,6 +278,10 @@ The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`
277
278
  where `buf` is a `Buffer` of the raw request body and `encoding` is the
278
279
  encoding of the request. The parsing can be aborted by throwing an error.
279
280
 
281
+ #### depth
282
+
283
+ The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible.
284
+
280
285
  ## Errors
281
286
 
282
287
  The middlewares provided by this module create errors using the
@@ -373,6 +378,10 @@ as well as in the `encoding` property. The `status` property is set to `415`,
373
378
  the `type` property is set to `'encoding.unsupported'`, and the `encoding`
374
379
  property is set to the encoding that is unsupported.
375
380
 
381
+ ### The input exceeded the depth
382
+
383
+ This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown.
384
+
376
385
  ## Examples
377
386
 
378
387
  ### Express/Connect top-level generic
@@ -463,3 +472,5 @@ app.use(bodyParser.text({ type: 'text/html' }))
463
472
  [npm-downloads-image]: https://badgen.net/npm/dm/body-parser
464
473
  [npm-url]: https://npmjs.org/package/body-parser
465
474
  [npm-version-image]: https://badgen.net/npm/v/body-parser
475
+ [ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge
476
+ [ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser
@@ -55,6 +55,9 @@ function urlencoded (options) {
55
55
  : opts.limit
56
56
  var type = opts.type || 'application/x-www-form-urlencoded'
57
57
  var verify = opts.verify || false
58
+ var depth = typeof opts.depth !== 'number'
59
+ ? Number(opts.depth || 32)
60
+ : opts.depth
58
61
 
59
62
  if (verify !== false && typeof verify !== 'function') {
60
63
  throw new TypeError('option verify must be function')
@@ -118,7 +121,8 @@ function urlencoded (options) {
118
121
  encoding: charset,
119
122
  inflate: inflate,
120
123
  limit: limit,
121
- verify: verify
124
+ verify: verify,
125
+ depth: depth
122
126
  })
123
127
  }
124
128
  }
@@ -133,12 +137,20 @@ function extendedparser (options) {
133
137
  var parameterLimit = options.parameterLimit !== undefined
134
138
  ? options.parameterLimit
135
139
  : 1000
140
+
141
+ var depth = typeof options.depth !== 'number'
142
+ ? Number(options.depth || 32)
143
+ : options.depth
136
144
  var parse = parser('qs')
137
145
 
138
146
  if (isNaN(parameterLimit) || parameterLimit < 1) {
139
147
  throw new TypeError('option parameterLimit must be a positive number')
140
148
  }
141
149
 
150
+ if (isNaN(depth) || depth < 0) {
151
+ throw new TypeError('option depth must be a zero or a positive number')
152
+ }
153
+
142
154
  if (isFinite(parameterLimit)) {
143
155
  parameterLimit = parameterLimit | 0
144
156
  }
@@ -156,12 +168,23 @@ function extendedparser (options) {
156
168
  var arrayLimit = Math.max(100, paramCount)
157
169
 
158
170
  debug('parse extended urlencoding')
159
- return parse(body, {
160
- allowPrototypes: true,
161
- arrayLimit: arrayLimit,
162
- depth: Infinity,
163
- parameterLimit: parameterLimit
164
- })
171
+ try {
172
+ return parse(body, {
173
+ allowPrototypes: true,
174
+ arrayLimit: arrayLimit,
175
+ depth: depth,
176
+ strictDepth: true,
177
+ parameterLimit: parameterLimit
178
+ })
179
+ } catch (err) {
180
+ if (err instanceof RangeError) {
181
+ throw createError(400, 'The input exceeded the depth', {
182
+ type: 'querystring.parse.rangeError'
183
+ })
184
+ } else {
185
+ throw err
186
+ }
187
+ }
165
188
  }
166
189
  }
167
190
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "body-parser",
3
3
  "description": "Node.js body parsing middleware",
4
- "version": "1.20.2",
4
+ "version": "1.20.3",
5
5
  "contributors": [
6
6
  "Douglas Christopher Wilson <doug@somethingdoug.com>",
7
7
  "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
@@ -17,7 +17,7 @@
17
17
  "http-errors": "2.0.0",
18
18
  "iconv-lite": "0.4.24",
19
19
  "on-finished": "2.4.1",
20
- "qs": "6.11.0",
20
+ "qs": "6.13.0",
21
21
  "raw-body": "2.5.2",
22
22
  "type-is": "~1.6.18",
23
23
  "unpipe": "1.0.0"
@@ -1,21 +1,11 @@
1
- # encodeurl
1
+ # Encode URL
2
2
 
3
- [![NPM Version][npm-image]][npm-url]
4
- [![NPM Downloads][downloads-image]][downloads-url]
5
- [![Node.js Version][node-version-image]][node-version-url]
6
- [![Build Status][travis-image]][travis-url]
7
- [![Test Coverage][coveralls-image]][coveralls-url]
8
-
9
- Encode a URL to a percent-encoded form, excluding already-encoded sequences
3
+ Encode a URL to a percent-encoded form, excluding already-encoded sequences.
10
4
 
11
5
  ## Installation
12
6
 
13
- This is a [Node.js](https://nodejs.org/en/) module available through the
14
- [npm registry](https://www.npmjs.com/). Installation is done using the
15
- [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
16
-
17
7
  ```sh
18
- $ npm install encodeurl
8
+ npm install encodeurl
19
9
  ```
20
10
 
21
11
  ## API
@@ -28,24 +18,13 @@ var encodeUrl = require('encodeurl')
28
18
 
29
19
  Encode a URL to a percent-encoded form, excluding already-encoded sequences.
30
20
 
31
- This function will take an already-encoded URL and encode all the non-URL
32
- code points (as UTF-8 byte sequences). This function will not encode the
33
- "%" character unless it is not part of a valid sequence (`%20` will be
34
- left as-is, but `%foo` will be encoded as `%25foo`).
21
+ This function accepts a URL and encodes all the non-URL code points (as UTF-8 byte sequences). It will not encode the "%" character unless it is not part of a valid sequence (`%20` will be left as-is, but `%foo` will be encoded as `%25foo`).
35
22
 
36
- This encode is meant to be "safe" and does not throw errors. It will try as
37
- hard as it can to properly encode the given URL, including replacing any raw,
38
- unpaired surrogate pairs with the Unicode replacement character prior to
39
- encoding.
40
-
41
- This function is _similar_ to the intrinsic function `encodeURI`, except it
42
- will not encode the `%` character if that is part of a valid sequence, will
43
- not encode `[` and `]` (for IPv6 hostnames) and will replace raw, unpaired
44
- surrogate pairs with the Unicode replacement character (instead of throwing).
23
+ This encode is meant to be "safe" and does not throw errors. It will try as hard as it can to properly encode the given URL, including replacing any raw, unpaired surrogate pairs with the Unicode replacement character prior to encoding.
45
24
 
46
25
  ## Examples
47
26
 
48
- ### Encode a URL containing user-controled data
27
+ ### Encode a URL containing user-controlled data
49
28
 
50
29
  ```js
51
30
  var encodeUrl = require('encodeurl')
@@ -97,6 +76,19 @@ http.createServer(function onRequest (req, res) {
97
76
  })
98
77
  ```
99
78
 
79
+ ## Similarities
80
+
81
+ This function is _similar_ to the intrinsic function `encodeURI`. However, it will not encode:
82
+
83
+ * The `\`, `^`, or `|` characters
84
+ * The `%` character when it's part of a valid sequence
85
+ * `[` and `]` (for IPv6 hostnames)
86
+ * Replaces raw, unpaired surrogate pairs with the Unicode replacement character
87
+
88
+ As a result, the encoding aligns closely with the behavior in the [WHATWG URL specification][whatwg-url]. However, this package only encodes strings and does not do any URL parsing or formatting.
89
+
90
+ It is expected that any output from `new URL(url)` will not change when used with this package, as the output has already been encoded. Additionally, if we were to encode before `new URL(url)`, we do not expect the before and after encoded formats to be parsed any differently.
91
+
100
92
  ## Testing
101
93
 
102
94
  ```sh
@@ -115,14 +107,3 @@ $ npm run lint
115
107
  ## License
116
108
 
117
109
  [MIT](LICENSE)
118
-
119
- [npm-image]: https://img.shields.io/npm/v/encodeurl.svg
120
- [npm-url]: https://npmjs.org/package/encodeurl
121
- [node-version-image]: https://img.shields.io/node/v/encodeurl.svg
122
- [node-version-url]: https://nodejs.org/en/download
123
- [travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg
124
- [travis-url]: https://travis-ci.org/pillarjs/encodeurl
125
- [coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg
126
- [coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master
127
- [downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg
128
- [downloads-url]: https://npmjs.org/package/encodeurl
@@ -19,7 +19,7 @@ module.exports = encodeUrl
19
19
  * @private
20
20
  */
21
21
 
22
- var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g
22
+ var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g
23
23
 
24
24
  /**
25
25
  * RegExp to match unmatched surrogate pair.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "encodeurl",
3
3
  "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences",
4
- "version": "1.0.2",
4
+ "version": "2.0.0",
5
5
  "contributors": [
6
6
  "Douglas Christopher Wilson <doug@somethingdoug.com>"
7
7
  ],
@@ -13,12 +13,12 @@
13
13
  ],
14
14
  "repository": "pillarjs/encodeurl",
15
15
  "devDependencies": {
16
- "eslint": "3.19.0",
17
- "eslint-config-standard": "10.2.1",
18
- "eslint-plugin-import": "2.8.0",
19
- "eslint-plugin-node": "5.2.1",
20
- "eslint-plugin-promise": "3.6.0",
21
- "eslint-plugin-standard": "3.0.1",
16
+ "eslint": "5.11.1",
17
+ "eslint-config-standard": "12.0.0",
18
+ "eslint-plugin-import": "2.14.0",
19
+ "eslint-plugin-node": "7.0.1",
20
+ "eslint-plugin-promise": "4.0.1",
21
+ "eslint-plugin-standard": "4.0.0",
22
22
  "istanbul": "0.4.5",
23
23
  "mocha": "2.5.3"
24
24
  },
@@ -1,3 +1,30 @@
1
+ 4.21.0 / 2024-09-11
2
+ ==========
3
+
4
+ * Deprecate `res.location("back")` and `res.redirect("back")` magic string
5
+ * deps: serve-static@1.16.2
6
+ * includes send@0.19.0
7
+ * deps: finalhandler@1.3.1
8
+ * deps: qs@6.13.0
9
+
10
+ 4.20.0 / 2024-09-10
11
+ ==========
12
+ * deps: serve-static@0.16.0
13
+ * Remove link renderization in html while redirecting
14
+ * deps: send@0.19.0
15
+ * Remove link renderization in html while redirecting
16
+ * deps: body-parser@0.6.0
17
+ * add `depth` option to customize the depth level in the parser
18
+ * IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`)
19
+ * Remove link renderization in html while using `res.redirect`
20
+ * deps: path-to-regexp@0.1.10
21
+ - Adds support for named matching groups in the routes using a regex
22
+ - Adds backtracking protection to parameters without regexes defined
23
+ * deps: encodeurl@~2.0.0
24
+ - Removes encoding of `\`, `|`, and `^` to align better with URL spec
25
+ * Deprecate passing `options.maxAge` and `options.expires` to `res.clearCookie`
26
+ - Will be ignored in v5, clearCookie will set a cookie with an expires in the past to instruct clients to delete the cookie
27
+
1
28
  4.19.2 / 2024-03-25
2
29
  ==========
3
30
 
@@ -1,10 +1,29 @@
1
1
  [![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/)
2
2
 
3
- Fast, unopinionated, minimalist web framework for [Node.js](http://nodejs.org).
3
+ **Fast, unopinionated, minimalist web framework for [Node.js](http://nodejs.org).**
4
+
5
+ **This project has a [Code of Conduct][].**
6
+
7
+ ## Table of contents
8
+
9
+ * [Installation](#Installation)
10
+ * [Features](#Features)
11
+ * [Docs & Community](#docs--community)
12
+ * [Quick Start](#Quick-Start)
13
+ * [Running Tests](#Running-Tests)
14
+ * [Philosophy](#Philosophy)
15
+ * [Examples](#Examples)
16
+ * [Contributing to Express](#Contributing)
17
+ * [TC (Technical Committee)](#tc-technical-committee)
18
+ * [Triagers](#triagers)
19
+ * [License](#license)
20
+
21
+
22
+ [![NPM Version][npm-version-image]][npm-url]
23
+ [![NPM Install Size][npm-install-size-image]][npm-install-size-url]
24
+ [![NPM Downloads][npm-downloads-image]][npm-downloads-url]
25
+ [![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
4
26
 
5
- [![NPM Version][npm-version-image]][npm-url]
6
- [![NPM Install Size][npm-install-size-image]][npm-install-size-url]
7
- [![NPM Downloads][npm-downloads-image]][npm-downloads-url]
8
27
 
9
28
  ```js
10
29
  const express = require('express')
@@ -144,10 +163,82 @@ $ npm test
144
163
 
145
164
  The original author of Express is [TJ Holowaychuk](https://github.com/tj)
146
165
 
147
- The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson)
148
-
149
166
  [List of all contributors](https://github.com/expressjs/express/graphs/contributors)
150
167
 
168
+ ### TC (Technical Committee)
169
+
170
+ * [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him)
171
+ * [jonchurch](https://github.com/jonchurch) - **Jon Church**
172
+ * [wesleytodd](https://github.com/wesleytodd) - **Wes Todd**
173
+ * [LinusU](https://github.com/LinusU) - **Linus Unnebäck**
174
+ * [blakeembrey](https://github.com/blakeembrey) - **Blake Embrey**
175
+ * [sheplu](https://github.com/sheplu) - **Jean Burellier**
176
+ * [crandmck](https://github.com/crandmck) - **Rand McKinney**
177
+ * [ctcpip](https://github.com/ctcpip) - **Chris de Almeida**
178
+
179
+ <details>
180
+ <summary>TC emeriti members</summary>
181
+
182
+ #### TC emeriti members
183
+
184
+ * [dougwilson](https://github.com/dougwilson) - **Douglas Wilson**
185
+ * [hacksparrow](https://github.com/hacksparrow) - **Hage Yaapa**
186
+ * [jonathanong](https://github.com/jonathanong) - **jongleberry**
187
+ * [niftylettuce](https://github.com/niftylettuce) - **niftylettuce**
188
+ * [troygoode](https://github.com/troygoode) - **Troy Goode**
189
+ </details>
190
+
191
+
192
+ ### Triagers
193
+
194
+ * [aravindvnair99](https://github.com/aravindvnair99) - **Aravind Nair**
195
+ * [carpasse](https://github.com/carpasse) - **Carlos Serrano**
196
+ * [CBID2](https://github.com/CBID2) - **Christine Belzie**
197
+ * [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim**
198
+ * [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him)
199
+ * [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin**
200
+ * [0ss](https://github.com/0ss) - **Salah**
201
+ * [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him)
202
+ * [3imed-jaberi](https://github.com/3imed-jaberi) - **Imed Jaberi**
203
+ * [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him)
204
+ * [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego**
205
+ * [IamLizu](https://github.com/IamLizu) - **S M Mahmudul Hasan** (he/him)
206
+ * [Sushmeet](https://github.com/Sushmeet) - **Sushmeet Sunger**
207
+
208
+ <details>
209
+ <summary>Triagers emeriti members</summary>
210
+
211
+ #### Emeritus Triagers
212
+
213
+ * [AuggieH](https://github.com/AuggieH) - **Auggie Hudak**
214
+ * [G-Rath](https://github.com/G-Rath) - **Gareth Jones**
215
+ * [MohammadXroid](https://github.com/MohammadXroid) - **Mohammad Ayashi**
216
+ * [NawafSwe](https://github.com/NawafSwe) - **Nawaf Alsharqi**
217
+ * [NotMoni](https://github.com/NotMoni) - **Moni**
218
+ * [VigneshMurugan](https://github.com/VigneshMurugan) - **Vignesh Murugan**
219
+ * [davidmashe](https://github.com/davidmashe) - **David Ashe**
220
+ * [digitaIfabric](https://github.com/digitaIfabric) - **David**
221
+ * [e-l-i-s-e](https://github.com/e-l-i-s-e) - **Elise Bonner**
222
+ * [fed135](https://github.com/fed135) - **Frederic Charette**
223
+ * [firmanJS](https://github.com/firmanJS) - **Firman Abdul Hakim**
224
+ * [getspooky](https://github.com/getspooky) - **Yasser Ameur**
225
+ * [ghinks](https://github.com/ghinks) - **Glenn**
226
+ * [ghousemohamed](https://github.com/ghousemohamed) - **Ghouse Mohamed**
227
+ * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil**
228
+ * [jake32321](https://github.com/jake32321) - **Jake Reed**
229
+ * [jonchurch](https://github.com/jonchurch) - **Jon Church**
230
+ * [lekanikotun](https://github.com/lekanikotun) - **Troy Goode**
231
+ * [marsonya](https://github.com/marsonya) - **Lekan Ikotun**
232
+ * [mastermatt](https://github.com/mastermatt) - **Matt R. Wilson**
233
+ * [maxakuru](https://github.com/maxakuru) - **Max Edell**
234
+ * [mlrawlings](https://github.com/mlrawlings) - **Michael Rawlings**
235
+ * [rodion-arr](https://github.com/rodion-arr) - **Rodion Abdurakhimov**
236
+ * [sheplu](https://github.com/sheplu) - **Jean Burellier**
237
+ * [tarunyadav1](https://github.com/tarunyadav1) - **Tarun yadav**
238
+ * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe**
239
+ </details>
240
+
241
+
151
242
  ## License
152
243
 
153
244
  [MIT](LICENSE)
@@ -164,3 +255,6 @@ The current lead maintainer is [Douglas Christopher Wilson](https://github.com/d
164
255
  [npm-install-size-url]: https://packagephobia.com/result?p=express
165
256
  [npm-url]: https://npmjs.org/package/express
166
257
  [npm-version-image]: https://badgen.net/npm/v/express
258
+ [ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/express/badge
259
+ [ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/express
260
+ [Code of Conduct]: https://github.com/expressjs/express/blob/master/Code-Of-Conduct.md
@@ -55,7 +55,6 @@ module.exports = res
55
55
  */
56
56
 
57
57
  var charsetRegExp = /;\s*charset\s*=/;
58
- var schemaAndHostRegExp = /^(?:[a-zA-Z][a-zA-Z0-9+.-]*:)?\/\/[^\\\/\?]+/;
59
58
 
60
59
  /**
61
60
  * Set status `code`.
@@ -823,6 +822,14 @@ res.get = function(field){
823
822
  */
824
823
 
825
824
  res.clearCookie = function clearCookie(name, options) {
825
+ if (options) {
826
+ if (options.maxAge) {
827
+ deprecate('res.clearCookie: Passing "options.maxAge" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.');
828
+ }
829
+ if (options.expires) {
830
+ deprecate('res.clearCookie: Passing "options.expires" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.');
831
+ }
832
+ }
826
833
  var opts = merge({ expires: new Date(1), path: '/' }, options);
827
834
 
828
835
  return this.cookie(name, '', opts);
@@ -909,19 +916,13 @@ res.location = function location(url) {
909
916
 
910
917
  // "back" is an alias for the referrer
911
918
  if (url === 'back') {
919
+ deprecate('res.location("back"): use res.location(req.get("Referrer") || "/") and refer to https://dub.sh/security-redirect for best practices');
912
920
  loc = this.req.get('Referrer') || '/';
913
921
  } else {
914
922
  loc = String(url);
915
923
  }
916
924
 
917
- var m = schemaAndHostRegExp.exec(loc);
918
- var pos = m ? m[0].length + 1 : 0;
919
-
920
- // Only encode after host to avoid invalid encoding which can introduce
921
- // vulnerabilities (e.g. `\\` to `%5C`).
922
- loc = loc.slice(0, pos) + encodeUrl(loc.slice(pos));
923
-
924
- return this.set('Location', loc);
925
+ return this.set('Location', encodeUrl(loc));
925
926
  };
926
927
 
927
928
  /**
@@ -969,7 +970,7 @@ res.redirect = function redirect(url) {
969
970
 
970
971
  html: function(){
971
972
  var u = escapeHtml(address);
972
- body = '<p>' + statuses.message[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>'
973
+ body = '<p>' + statuses.message[status] + '. Redirecting to ' + u + '</p>'
973
974
  },
974
975
 
975
976
  default: function(){
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "express",
3
3
  "description": "Fast, unopinionated, minimalist web framework",
4
- "version": "4.19.2",
4
+ "version": "4.21.0",
5
5
  "author": "TJ Holowaychuk <tj@vision-media.ca>",
6
6
  "contributors": [
7
7
  "Aaron Heckmann <aaron.heckmann+github@gmail.com>",
@@ -30,30 +30,30 @@
30
30
  "dependencies": {
31
31
  "accepts": "~1.3.8",
32
32
  "array-flatten": "1.1.1",
33
- "body-parser": "1.20.2",
33
+ "body-parser": "1.20.3",
34
34
  "content-disposition": "0.5.4",
35
35
  "content-type": "~1.0.4",
36
36
  "cookie": "0.6.0",
37
37
  "cookie-signature": "1.0.6",
38
38
  "debug": "2.6.9",
39
39
  "depd": "2.0.0",
40
- "encodeurl": "~1.0.2",
40
+ "encodeurl": "~2.0.0",
41
41
  "escape-html": "~1.0.3",
42
42
  "etag": "~1.8.1",
43
- "finalhandler": "1.2.0",
43
+ "finalhandler": "1.3.1",
44
44
  "fresh": "0.5.2",
45
45
  "http-errors": "2.0.0",
46
- "merge-descriptors": "1.0.1",
46
+ "merge-descriptors": "1.0.3",
47
47
  "methods": "~1.1.2",
48
48
  "on-finished": "2.4.1",
49
49
  "parseurl": "~1.3.3",
50
- "path-to-regexp": "0.1.7",
50
+ "path-to-regexp": "0.1.10",
51
51
  "proxy-addr": "~2.0.7",
52
- "qs": "6.11.0",
52
+ "qs": "6.13.0",
53
53
  "range-parser": "~1.2.1",
54
54
  "safe-buffer": "5.2.1",
55
- "send": "0.18.0",
56
- "serve-static": "1.15.0",
55
+ "send": "0.19.0",
56
+ "serve-static": "1.16.2",
57
57
  "setprototypeof": "1.2.0",
58
58
  "statuses": "2.0.1",
59
59
  "type-is": "~1.6.18",
@@ -91,8 +91,8 @@
91
91
  "scripts": {
92
92
  "lint": "eslint .",
93
93
  "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",
94
- "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
95
- "test-cov": "nyc --reporter=html --reporter=text npm test",
94
+ "test-ci": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=lcovonly --reporter=text npm test",
95
+ "test-cov": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=html --reporter=text npm test",
96
96
  "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"
97
97
  }
98
98
  }
@@ -1,3 +1,18 @@
1
+ v1.3.1 / 2024-09-11
2
+ ==================
3
+
4
+ * deps: encodeurl@~2.0.0
5
+
6
+ v1.3.0 / 2024-09-03
7
+ ==================
8
+
9
+ * ignore status message for HTTP/2 (#53)
10
+
11
+ v1.2.1 / 2024-09-02
12
+ ==================
13
+
14
+ * Gracefully handle when handling an error and socket is null
15
+
1
16
  1.2.0 / 2022-03-22
2
17
  ==================
3
18
 
@@ -143,5 +143,5 @@ function logerror (err) {
143
143
  [coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master
144
144
  [downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg
145
145
  [downloads-url]: https://npmjs.org/package/finalhandler
146
- [github-actions-ci-image]: https://img.shields.io/github/workflow/status/pillarjs/finalhandler/ci/master?label=ci
147
- [github-actions-ci-url]: https://github.com/jshttp/pillarjs/finalhandler?query=workflow%3Aci
146
+ [github-actions-ci-image]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml/badge.svg
147
+ [github-actions-ci-url]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml
@@ -125,7 +125,9 @@ function finalhandler (req, res, options) {
125
125
  // cannot actually respond
126
126
  if (headersSent(res)) {
127
127
  debug('cannot %d after headers sent', status)
128
- req.socket.destroy()
128
+ if (req.socket) {
129
+ req.socket.destroy()
130
+ }
129
131
  return
130
132
  }
131
133
 
@@ -276,7 +278,10 @@ function send (req, res, status, headers, message) {
276
278
 
277
279
  // response status
278
280
  res.statusCode = status
279
- res.statusMessage = statuses.message[status]
281
+
282
+ if (req.httpVersionMajor < 2) {
283
+ res.statusMessage = statuses.message[status]
284
+ }
280
285
 
281
286
  // remove any content headers
282
287
  res.removeHeader('Content-Encoding')
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "finalhandler",
3
3
  "description": "Node.js final http responder",
4
- "version": "1.2.0",
4
+ "version": "1.3.1",
5
5
  "author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
6
6
  "license": "MIT",
7
7
  "repository": "pillarjs/finalhandler",
8
8
  "dependencies": {
9
9
  "debug": "2.6.9",
10
- "encodeurl": "~1.0.2",
10
+ "encodeurl": "~2.0.0",
11
11
  "escape-html": "~1.0.3",
12
12
  "on-finished": "2.4.1",
13
13
  "parseurl": "~1.3.3",
@@ -17,16 +17,16 @@
17
17
  "devDependencies": {
18
18
  "eslint": "7.32.0",
19
19
  "eslint-config-standard": "14.1.1",
20
- "eslint-plugin-import": "2.25.4",
20
+ "eslint-plugin-import": "2.26.0",
21
21
  "eslint-plugin-markdown": "2.2.1",
22
22
  "eslint-plugin-node": "11.1.0",
23
23
  "eslint-plugin-promise": "5.2.0",
24
24
  "eslint-plugin-standard": "4.1.0",
25
- "mocha": "9.2.2",
25
+ "mocha": "10.0.0",
26
26
  "nyc": "15.1.0",
27
27
  "readable-stream": "2.3.6",
28
28
  "safe-buffer": "5.2.1",
29
- "supertest": "6.2.2"
29
+ "supertest": "6.2.4"
30
30
  },
31
31
  "files": [
32
32
  "LICENSE",
@@ -39,8 +39,9 @@
39
39
  },
40
40
  "scripts": {
41
41
  "lint": "eslint .",
42
- "test": "mocha --reporter spec --bail --check-leaks test/",
42
+ "test": "mocha --reporter spec --check-leaks test/",
43
43
  "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
44
- "test-cov": "nyc --reporter=html --reporter=text npm test"
44
+ "test-cov": "nyc --reporter=html --reporter=text npm test",
45
+ "test-inspect": "mocha --reporter spec --inspect --inspect-brk test/"
45
46
  }
46
47
  }