node-red-contrib-web-worldmap 2.29.0 → 2.30.1

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 (188) hide show
  1. package/.github/FUNDING.yml +13 -0
  2. package/CHANGELOG.md +5 -2
  3. package/README.md +3 -0
  4. package/node_modules/array-flatten/package.json +6 -9
  5. package/node_modules/body-parser/HISTORY.md +18 -0
  6. package/node_modules/body-parser/README.md +9 -1
  7. package/node_modules/body-parser/SECURITY.md +25 -0
  8. package/node_modules/body-parser/lib/read.js +26 -2
  9. package/node_modules/body-parser/lib/types/json.js +10 -4
  10. package/node_modules/body-parser/package.json +24 -20
  11. package/node_modules/call-bind/.eslintignore +1 -0
  12. package/node_modules/call-bind/.eslintrc +17 -0
  13. package/node_modules/call-bind/.github/FUNDING.yml +12 -0
  14. package/node_modules/call-bind/.nycrc +13 -0
  15. package/node_modules/call-bind/CHANGELOG.md +42 -0
  16. package/node_modules/call-bind/LICENSE +21 -0
  17. package/node_modules/call-bind/README.md +2 -0
  18. package/node_modules/call-bind/callBound.js +15 -0
  19. package/node_modules/call-bind/index.js +47 -0
  20. package/node_modules/call-bind/package.json +108 -0
  21. package/node_modules/call-bind/test/callBound.js +55 -0
  22. package/node_modules/call-bind/test/index.js +66 -0
  23. package/node_modules/cookie/HISTORY.md +8 -0
  24. package/node_modules/cookie/README.md +50 -34
  25. package/node_modules/cookie/SECURITY.md +25 -0
  26. package/node_modules/cookie/index.js +83 -15
  27. package/node_modules/cookie/package.json +17 -15
  28. package/node_modules/cookie-signature/package.json +6 -9
  29. package/node_modules/depd/History.md +7 -0
  30. package/node_modules/depd/LICENSE +1 -1
  31. package/node_modules/depd/Readme.md +8 -8
  32. package/node_modules/depd/index.js +29 -13
  33. package/node_modules/depd/package.json +25 -24
  34. package/node_modules/destroy/LICENSE +1 -0
  35. package/node_modules/destroy/README.md +15 -12
  36. package/node_modules/destroy/index.js +147 -13
  37. package/node_modules/destroy/package.json +29 -20
  38. package/node_modules/ee-first/package.json +6 -9
  39. package/node_modules/encodeurl/package.json +11 -14
  40. package/node_modules/escape-html/package.json +11 -14
  41. package/node_modules/etag/package.json +11 -14
  42. package/node_modules/express/History.md +54 -0
  43. package/node_modules/express/Readme.md +39 -31
  44. package/node_modules/express/lib/application.js +18 -1
  45. package/node_modules/express/lib/response.js +40 -18
  46. package/node_modules/express/lib/router/index.js +20 -15
  47. package/node_modules/express/lib/router/route.js +9 -0
  48. package/node_modules/express/lib/utils.js +1 -0
  49. package/node_modules/express/lib/view.js +1 -1
  50. package/node_modules/express/package.json +25 -26
  51. package/node_modules/finalhandler/HISTORY.md +8 -0
  52. package/node_modules/finalhandler/LICENSE +1 -1
  53. package/node_modules/finalhandler/README.md +5 -6
  54. package/node_modules/finalhandler/SECURITY.md +25 -0
  55. package/node_modules/finalhandler/index.js +8 -3
  56. package/node_modules/finalhandler/package.json +30 -32
  57. package/node_modules/fresh/package.json +6 -9
  58. package/node_modules/function-bind/.editorconfig +20 -0
  59. package/node_modules/function-bind/.eslintrc +15 -0
  60. package/node_modules/function-bind/.jscs.json +176 -0
  61. package/node_modules/function-bind/.npmignore +22 -0
  62. package/node_modules/function-bind/.travis.yml +168 -0
  63. package/node_modules/function-bind/LICENSE +20 -0
  64. package/node_modules/function-bind/README.md +48 -0
  65. package/node_modules/function-bind/implementation.js +52 -0
  66. package/node_modules/function-bind/index.js +5 -0
  67. package/node_modules/function-bind/package.json +96 -0
  68. package/node_modules/function-bind/test/.eslintrc +9 -0
  69. package/node_modules/function-bind/test/index.js +252 -0
  70. package/node_modules/get-intrinsic/.eslintrc +37 -0
  71. package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  72. package/node_modules/get-intrinsic/.nycrc +9 -0
  73. package/node_modules/get-intrinsic/CHANGELOG.md +98 -0
  74. package/node_modules/get-intrinsic/LICENSE +21 -0
  75. package/node_modules/get-intrinsic/README.md +71 -0
  76. package/node_modules/get-intrinsic/index.js +334 -0
  77. package/node_modules/get-intrinsic/package.json +120 -0
  78. package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  79. package/node_modules/has/LICENSE-MIT +22 -0
  80. package/node_modules/has/README.md +18 -0
  81. package/node_modules/has/package.json +73 -0
  82. package/node_modules/has/src/index.js +5 -0
  83. package/node_modules/has/test/index.js +10 -0
  84. package/node_modules/has-symbols/.eslintrc +11 -0
  85. package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  86. package/node_modules/has-symbols/.nycrc +9 -0
  87. package/node_modules/has-symbols/CHANGELOG.md +75 -0
  88. package/node_modules/has-symbols/LICENSE +21 -0
  89. package/node_modules/has-symbols/README.md +46 -0
  90. package/node_modules/has-symbols/index.js +13 -0
  91. package/node_modules/has-symbols/package.json +126 -0
  92. package/node_modules/has-symbols/shams.js +42 -0
  93. package/node_modules/has-symbols/test/index.js +22 -0
  94. package/node_modules/has-symbols/test/shams/core-js.js +28 -0
  95. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +28 -0
  96. package/node_modules/has-symbols/test/tests.js +56 -0
  97. package/node_modules/http-errors/HISTORY.md +15 -0
  98. package/node_modules/http-errors/README.md +2 -2
  99. package/node_modules/http-errors/index.js +15 -25
  100. package/node_modules/http-errors/package.json +22 -20
  101. package/node_modules/media-typer/package.json +6 -9
  102. package/node_modules/merge-descriptors/package.json +6 -9
  103. package/node_modules/methods/package.json +11 -14
  104. package/node_modules/object-inspect/.eslintrc +53 -0
  105. package/node_modules/object-inspect/.github/FUNDING.yml +12 -0
  106. package/node_modules/object-inspect/.nycrc +13 -0
  107. package/node_modules/object-inspect/CHANGELOG.md +360 -0
  108. package/node_modules/object-inspect/LICENSE +21 -0
  109. package/node_modules/object-inspect/example/all.js +23 -0
  110. package/node_modules/object-inspect/example/circular.js +6 -0
  111. package/node_modules/object-inspect/example/fn.js +5 -0
  112. package/node_modules/object-inspect/example/inspect.js +10 -0
  113. package/node_modules/object-inspect/index.js +512 -0
  114. package/node_modules/object-inspect/package-support.json +20 -0
  115. package/node_modules/object-inspect/package.json +122 -0
  116. package/node_modules/object-inspect/readme.markdown +86 -0
  117. package/node_modules/object-inspect/test/bigint.js +58 -0
  118. package/node_modules/object-inspect/test/browser/dom.js +15 -0
  119. package/node_modules/object-inspect/test/circular.js +16 -0
  120. package/node_modules/object-inspect/test/deep.js +12 -0
  121. package/node_modules/object-inspect/test/element.js +53 -0
  122. package/node_modules/object-inspect/test/err.js +48 -0
  123. package/node_modules/object-inspect/test/fakes.js +29 -0
  124. package/node_modules/object-inspect/test/fn.js +76 -0
  125. package/node_modules/object-inspect/test/has.js +15 -0
  126. package/node_modules/object-inspect/test/holes.js +15 -0
  127. package/node_modules/object-inspect/test/indent-option.js +271 -0
  128. package/node_modules/object-inspect/test/inspect.js +139 -0
  129. package/node_modules/object-inspect/test/lowbyte.js +12 -0
  130. package/node_modules/object-inspect/test/number.js +58 -0
  131. package/node_modules/object-inspect/test/quoteStyle.js +17 -0
  132. package/node_modules/object-inspect/test/toStringTag.js +40 -0
  133. package/node_modules/object-inspect/test/undef.js +12 -0
  134. package/node_modules/object-inspect/test/values.js +211 -0
  135. package/node_modules/object-inspect/test-core-js.js +26 -0
  136. package/node_modules/object-inspect/util.inspect.js +1 -0
  137. package/node_modules/on-finished/HISTORY.md +10 -0
  138. package/node_modules/on-finished/README.md +28 -20
  139. package/node_modules/on-finished/index.js +51 -13
  140. package/node_modules/on-finished/package.json +25 -20
  141. package/node_modules/path-to-regexp/package.json +6 -9
  142. package/node_modules/qs/CHANGELOG.md +22 -5
  143. package/node_modules/qs/README.md +7 -0
  144. package/node_modules/qs/dist/qs.js +1207 -5
  145. package/node_modules/qs/lib/parse.js +6 -0
  146. package/node_modules/qs/lib/stringify.js +33 -3
  147. package/node_modules/qs/package.json +16 -13
  148. package/node_modules/qs/test/parse.js +9 -0
  149. package/node_modules/qs/test/stringify.js +62 -1
  150. package/node_modules/raw-body/HISTORY.md +14 -0
  151. package/node_modules/raw-body/LICENSE +1 -1
  152. package/node_modules/raw-body/README.md +4 -0
  153. package/node_modules/raw-body/SECURITY.md +24 -0
  154. package/node_modules/raw-body/index.js +45 -2
  155. package/node_modules/raw-body/package.json +16 -15
  156. package/node_modules/send/HISTORY.md +15 -0
  157. package/node_modules/send/LICENSE +1 -1
  158. package/node_modules/send/README.md +2 -2
  159. package/node_modules/send/SECURITY.md +24 -0
  160. package/node_modules/send/index.js +37 -27
  161. package/node_modules/send/package.json +22 -21
  162. package/node_modules/serve-static/HISTORY.md +12 -0
  163. package/node_modules/serve-static/README.md +1 -1
  164. package/node_modules/serve-static/package.json +16 -16
  165. package/node_modules/side-channel/.eslintignore +1 -0
  166. package/node_modules/side-channel/.eslintrc +11 -0
  167. package/node_modules/side-channel/.github/FUNDING.yml +12 -0
  168. package/node_modules/side-channel/.nycrc +13 -0
  169. package/node_modules/side-channel/CHANGELOG.md +65 -0
  170. package/node_modules/side-channel/LICENSE +21 -0
  171. package/node_modules/side-channel/README.md +2 -0
  172. package/node_modules/side-channel/index.js +124 -0
  173. package/node_modules/side-channel/package.json +95 -0
  174. package/node_modules/side-channel/test/index.js +78 -0
  175. package/node_modules/statuses/HISTORY.md +17 -0
  176. package/node_modules/statuses/README.md +51 -42
  177. package/node_modules/statuses/codes.json +2 -3
  178. package/node_modules/statuses/index.js +52 -19
  179. package/node_modules/statuses/package.json +29 -31
  180. package/node_modules/unpipe/package.json +7 -9
  181. package/node_modules/utils-merge/package.json +6 -9
  182. package/package.json +2 -2
  183. package/worldmap/worldmap.js +22 -7
  184. package/worldmap.html +16 -0
  185. package/worldmap.js +553 -551
  186. package/node_modules/depd/lib/compat/callsite-tostring.js +0 -103
  187. package/node_modules/depd/lib/compat/event-listener-count.js +0 -22
  188. package/node_modules/depd/lib/compat/index.js +0 -79
@@ -1,25 +1,19 @@
1
1
  {
2
- "_args": [
3
- [
4
- "escape-html@1.0.3",
5
- "/Users/conway/Projects/worldmap"
6
- ]
7
- ],
8
- "_from": "escape-html@1.0.3",
2
+ "_from": "escape-html@~1.0.3",
9
3
  "_id": "escape-html@1.0.3",
10
4
  "_inBundle": false,
11
- "_integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=",
5
+ "_integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
12
6
  "_location": "/escape-html",
13
7
  "_phantomChildren": {},
14
8
  "_requested": {
15
- "type": "version",
9
+ "type": "range",
16
10
  "registry": true,
17
- "raw": "escape-html@1.0.3",
11
+ "raw": "escape-html@~1.0.3",
18
12
  "name": "escape-html",
19
13
  "escapedName": "escape-html",
20
- "rawSpec": "1.0.3",
14
+ "rawSpec": "~1.0.3",
21
15
  "saveSpec": null,
22
- "fetchSpec": "1.0.3"
16
+ "fetchSpec": "~1.0.3"
23
17
  },
24
18
  "_requiredBy": [
25
19
  "/express",
@@ -28,11 +22,14 @@
28
22
  "/serve-static"
29
23
  ],
30
24
  "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
31
- "_spec": "1.0.3",
32
- "_where": "/Users/conway/Projects/worldmap",
25
+ "_shasum": "0258eae4d3d0c0974de1c169188ef0051d1d1988",
26
+ "_spec": "escape-html@~1.0.3",
27
+ "_where": "/Users/conway/Projects/worldmap/node_modules/express",
33
28
  "bugs": {
34
29
  "url": "https://github.com/component/escape-html/issues"
35
30
  },
31
+ "bundleDependencies": false,
32
+ "deprecated": false,
36
33
  "description": "Escape string for use in HTML",
37
34
  "devDependencies": {
38
35
  "beautify-benchmark": "0.2.4",
@@ -1,36 +1,32 @@
1
1
  {
2
- "_args": [
3
- [
4
- "etag@1.8.1",
5
- "/Users/conway/Projects/worldmap"
6
- ]
7
- ],
8
- "_from": "etag@1.8.1",
2
+ "_from": "etag@~1.8.1",
9
3
  "_id": "etag@1.8.1",
10
4
  "_inBundle": false,
11
- "_integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=",
5
+ "_integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
12
6
  "_location": "/etag",
13
7
  "_phantomChildren": {},
14
8
  "_requested": {
15
- "type": "version",
9
+ "type": "range",
16
10
  "registry": true,
17
- "raw": "etag@1.8.1",
11
+ "raw": "etag@~1.8.1",
18
12
  "name": "etag",
19
13
  "escapedName": "etag",
20
- "rawSpec": "1.8.1",
14
+ "rawSpec": "~1.8.1",
21
15
  "saveSpec": null,
22
- "fetchSpec": "1.8.1"
16
+ "fetchSpec": "~1.8.1"
23
17
  },
24
18
  "_requiredBy": [
25
19
  "/express",
26
20
  "/send"
27
21
  ],
28
22
  "_resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
29
- "_spec": "1.8.1",
30
- "_where": "/Users/conway/Projects/worldmap",
23
+ "_shasum": "41ae2eeb65efa62268aebfea83ac7d79299b0887",
24
+ "_spec": "etag@~1.8.1",
25
+ "_where": "/Users/conway/Projects/worldmap/node_modules/express",
31
26
  "bugs": {
32
27
  "url": "https://github.com/jshttp/etag/issues"
33
28
  },
29
+ "bundleDependencies": false,
34
30
  "contributors": [
35
31
  {
36
32
  "name": "Douglas Christopher Wilson",
@@ -41,6 +37,7 @@
41
37
  "email": "david.bjorklund@gmail.com"
42
38
  }
43
39
  ],
40
+ "deprecated": false,
44
41
  "description": "Create simple HTTP ETags",
45
42
  "devDependencies": {
46
43
  "beautify-benchmark": "0.2.4",
@@ -1,3 +1,57 @@
1
+ 4.18.1 / 2022-04-29
2
+ ===================
3
+
4
+ * Fix hanging on large stack of sync routes
5
+
6
+ 4.18.0 / 2022-04-25
7
+ ===================
8
+
9
+ * Add "root" option to `res.download`
10
+ * Allow `options` without `filename` in `res.download`
11
+ * Deprecate string and non-integer arguments to `res.status`
12
+ * Fix behavior of `null`/`undefined` as `maxAge` in `res.cookie`
13
+ * Fix handling very large stacks of sync middleware
14
+ * Ignore `Object.prototype` values in settings through `app.set`/`app.get`
15
+ * Invoke `default` with same arguments as types in `res.format`
16
+ * Support proper 205 responses using `res.send`
17
+ * Use `http-errors` for `res.format` error
18
+ * deps: body-parser@1.20.0
19
+ - Fix error message for json parse whitespace in `strict`
20
+ - Fix internal error when inflated body exceeds limit
21
+ - Prevent loss of async hooks context
22
+ - Prevent hanging when request already read
23
+ - deps: depd@2.0.0
24
+ - deps: http-errors@2.0.0
25
+ - deps: on-finished@2.4.1
26
+ - deps: qs@6.10.3
27
+ - deps: raw-body@2.5.1
28
+ * deps: cookie@0.5.0
29
+ - Add `priority` option
30
+ - Fix `expires` option to reject invalid dates
31
+ * deps: depd@2.0.0
32
+ - Replace internal `eval` usage with `Function` constructor
33
+ - Use instance methods on `process` to check for listeners
34
+ * deps: finalhandler@1.2.0
35
+ - Remove set content headers that break response
36
+ - deps: on-finished@2.4.1
37
+ - deps: statuses@2.0.1
38
+ * deps: on-finished@2.4.1
39
+ - Prevent loss of async hooks context
40
+ * deps: qs@6.10.3
41
+ * deps: send@0.18.0
42
+ - Fix emitted 416 error missing headers property
43
+ - Limit the headers removed for 304 response
44
+ - deps: depd@2.0.0
45
+ - deps: destroy@1.2.0
46
+ - deps: http-errors@2.0.0
47
+ - deps: on-finished@2.4.1
48
+ - deps: statuses@2.0.1
49
+ * deps: serve-static@1.15.0
50
+ - deps: send@0.18.0
51
+ * deps: statuses@2.0.1
52
+ - Remove code 306
53
+ - Rename `425 Unordered Collection` to standard `425 Too Early`
54
+
1
55
  4.17.3 / 2022-02-16
2
56
  ===================
3
57
 
@@ -2,11 +2,9 @@
2
2
 
3
3
  Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).
4
4
 
5
- [![NPM Version][npm-image]][npm-url]
6
- [![NPM Downloads][downloads-image]][downloads-url]
7
- [![Linux Build][ci-image]][ci-url]
8
- [![Windows Build][appveyor-image]][appveyor-url]
9
- [![Test Coverage][coveralls-image]][coveralls-url]
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]
10
8
 
11
9
  ```js
12
10
  const express = require('express')
@@ -33,7 +31,7 @@ the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file).
33
31
  Installation is done using the
34
32
  [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
35
33
 
36
- ```bash
34
+ ```console
37
35
  $ npm install express
38
36
  ```
39
37
 
@@ -61,35 +59,31 @@ for more information.
61
59
 
62
60
  **PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x).
63
61
 
64
- ### Security Issues
65
-
66
- If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).
67
-
68
62
  ## Quick Start
69
63
 
70
64
  The quickest way to get started with express is to utilize the executable [`express(1)`](https://github.com/expressjs/generator) to generate an application as shown below:
71
65
 
72
66
  Install the executable. The executable's major version will match Express's:
73
67
 
74
- ```bash
68
+ ```console
75
69
  $ npm install -g express-generator@4
76
70
  ```
77
71
 
78
72
  Create the app:
79
73
 
80
- ```bash
74
+ ```console
81
75
  $ express /tmp/foo && cd /tmp/foo
82
76
  ```
83
77
 
84
78
  Install dependencies:
85
79
 
86
- ```bash
80
+ ```console
87
81
  $ npm install
88
82
  ```
89
83
 
90
84
  Start the server:
91
85
 
92
- ```bash
86
+ ```console
93
87
  $ npm start
94
88
  ```
95
89
 
@@ -109,7 +103,7 @@ $ npm start
109
103
 
110
104
  To view the examples, clone the Express repo and install the dependencies:
111
105
 
112
- ```bash
106
+ ```console
113
107
  $ git clone git://github.com/expressjs/express.git --depth 1
114
108
  $ cd express
115
109
  $ npm install
@@ -117,23 +111,35 @@ $ npm install
117
111
 
118
112
  Then run whichever example you want:
119
113
 
120
- ```bash
114
+ ```console
121
115
  $ node examples/content-negotiation
122
116
  ```
123
117
 
124
- ## Tests
118
+ ## Contributing
119
+
120
+ [![Linux Build][github-actions-ci-image]][github-actions-ci-url]
121
+ [![Windows Build][appveyor-image]][appveyor-url]
122
+ [![Test Coverage][coveralls-image]][coveralls-url]
123
+
124
+ The Express.js project welcomes all constructive contributions. Contributions take many forms,
125
+ from code for bug fixes and enhancements, to additions and fixes to documentation, additional
126
+ tests, triaging incoming pull requests and issues, and more!
125
127
 
126
- To run the test suite, first install the dependencies, then run `npm test`:
128
+ See the [Contributing Guide](Contributing.md) for more technical details on contributing.
127
129
 
128
- ```bash
130
+ ### Security Issues
131
+
132
+ If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).
133
+
134
+ ### Running Tests
135
+
136
+ To run the test suite, first install the dependencies, then run `npm test`:
137
+
138
+ ```console
129
139
  $ npm install
130
140
  $ npm test
131
141
  ```
132
142
 
133
- ## Contributing
134
-
135
- [Contributing Guide](Contributing.md)
136
-
137
143
  ## People
138
144
 
139
145
  The original author of Express is [TJ Holowaychuk](https://github.com/tj)
@@ -146,13 +152,15 @@ The current lead maintainer is [Douglas Christopher Wilson](https://github.com/d
146
152
 
147
153
  [MIT](LICENSE)
148
154
 
149
- [ci-image]: https://img.shields.io/github/workflow/status/expressjs/express/ci/master.svg?label=linux
150
- [ci-url]: https://github.com/expressjs/express/actions?query=workflow%3Aci
151
- [npm-image]: https://img.shields.io/npm/v/express.svg
152
- [npm-url]: https://npmjs.org/package/express
153
- [downloads-image]: https://img.shields.io/npm/dm/express.svg
154
- [downloads-url]: https://npmcharts.com/compare/express?minimal=true
155
- [appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows
155
+ [appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/express/master?label=windows
156
156
  [appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
157
- [coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg
157
+ [coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/express/master
158
158
  [coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master
159
+ [github-actions-ci-image]: https://badgen.net/github/checks/expressjs/express/master?label=linux
160
+ [github-actions-ci-url]: https://github.com/expressjs/express/actions/workflows/ci.yml
161
+ [npm-downloads-image]: https://badgen.net/npm/dm/express
162
+ [npm-downloads-url]: https://npmcharts.com/compare/express?minimal=true
163
+ [npm-install-size-image]: https://badgen.net/packagephobia/install/express
164
+ [npm-install-size-url]: https://packagephobia.com/result?p=express
165
+ [npm-url]: https://npmjs.org/package/express
166
+ [npm-version-image]: https://badgen.net/npm/v/express
@@ -29,6 +29,13 @@ var flatten = require('array-flatten');
29
29
  var merge = require('utils-merge');
30
30
  var resolve = require('path').resolve;
31
31
  var setPrototypeOf = require('setprototypeof')
32
+
33
+ /**
34
+ * Module variables.
35
+ * @private
36
+ */
37
+
38
+ var hasOwnProperty = Object.prototype.hasOwnProperty
32
39
  var slice = Array.prototype.slice;
33
40
 
34
41
  /**
@@ -352,7 +359,17 @@ app.param = function param(name, fn) {
352
359
  app.set = function set(setting, val) {
353
360
  if (arguments.length === 1) {
354
361
  // app.get(setting)
355
- return this.settings[setting];
362
+ var settings = this.settings
363
+
364
+ while (settings && settings !== Object.prototype) {
365
+ if (hasOwnProperty.call(settings, setting)) {
366
+ return settings[setting]
367
+ }
368
+
369
+ settings = Object.getPrototypeOf(settings)
370
+ }
371
+
372
+ return undefined
356
373
  }
357
374
 
358
375
  debug('set "%s" to %o', setting, val);
@@ -14,6 +14,7 @@
14
14
 
15
15
  var Buffer = require('safe-buffer').Buffer
16
16
  var contentDisposition = require('content-disposition');
17
+ var createError = require('http-errors')
17
18
  var deprecate = require('depd')('express');
18
19
  var encodeUrl = require('encodeurl');
19
20
  var escapeHtml = require('escape-html');
@@ -64,6 +65,9 @@ var charsetRegExp = /;\s*charset\s*=/;
64
65
  */
65
66
 
66
67
  res.status = function status(code) {
68
+ if ((typeof code === 'string' || Math.floor(code) !== code) && code > 99 && code < 1000) {
69
+ deprecate('res.status(' + JSON.stringify(code) + '): use res.status(' + Math.floor(code) + ') instead')
70
+ }
67
71
  this.statusCode = code;
68
72
  return this;
69
73
  };
@@ -135,7 +139,7 @@ res.send = function send(body) {
135
139
 
136
140
  deprecate('res.send(status): Use res.sendStatus(status) instead');
137
141
  this.statusCode = chunk;
138
- chunk = statuses[chunk]
142
+ chunk = statuses.message[chunk]
139
143
  }
140
144
 
141
145
  switch (typeof chunk) {
@@ -213,6 +217,13 @@ res.send = function send(body) {
213
217
  chunk = '';
214
218
  }
215
219
 
220
+ // alter headers for 205
221
+ if (this.statusCode === 205) {
222
+ this.set('Content-Length', '0')
223
+ this.removeHeader('Transfer-Encoding')
224
+ chunk = ''
225
+ }
226
+
216
227
  if (req.method === 'HEAD') {
217
228
  // skip body for HEAD
218
229
  this.end();
@@ -356,7 +367,7 @@ res.jsonp = function jsonp(obj) {
356
367
  */
357
368
 
358
369
  res.sendStatus = function sendStatus(statusCode) {
359
- var body = statuses[statusCode] || String(statusCode)
370
+ var body = statuses.message[statusCode] || String(statusCode)
360
371
 
361
372
  this.statusCode = statusCode;
362
373
  this.type('txt');
@@ -551,6 +562,13 @@ res.download = function download (path, filename, options, callback) {
551
562
  opts = null
552
563
  }
553
564
 
565
+ // support optional filename, where options may be in it's place
566
+ if (typeof filename === 'object' &&
567
+ (typeof options === 'function' || options === undefined)) {
568
+ name = null
569
+ opts = filename
570
+ }
571
+
554
572
  // set Content-Disposition when file is sent
555
573
  var headers = {
556
574
  'Content-Disposition': contentDisposition(name || path)
@@ -572,7 +590,9 @@ res.download = function download (path, filename, options, callback) {
572
590
  opts.headers = headers
573
591
 
574
592
  // Resolve the full path for sendFile
575
- var fullPath = resolve(path);
593
+ var fullPath = !opts.root
594
+ ? resolve(path)
595
+ : path
576
596
 
577
597
  // send file
578
598
  return this.sendFile(fullPath, opts, done)
@@ -665,9 +685,8 @@ res.format = function(obj){
665
685
  var req = this.req;
666
686
  var next = req.next;
667
687
 
668
- var fn = obj.default;
669
- if (fn) delete obj.default;
670
- var keys = Object.keys(obj);
688
+ var keys = Object.keys(obj)
689
+ .filter(function (v) { return v !== 'default' })
671
690
 
672
691
  var key = keys.length > 0
673
692
  ? req.accepts(keys)
@@ -678,13 +697,12 @@ res.format = function(obj){
678
697
  if (key) {
679
698
  this.set('Content-Type', normalizeType(key).value);
680
699
  obj[key](req, this, next);
681
- } else if (fn) {
682
- fn();
700
+ } else if (obj.default) {
701
+ obj.default(req, this, next)
683
702
  } else {
684
- var err = new Error('Not Acceptable');
685
- err.status = err.statusCode = 406;
686
- err.types = normalizeTypes(keys).map(function(o){ return o.value });
687
- next(err);
703
+ next(createError(406, {
704
+ types: normalizeTypes(keys).map(function (o) { return o.value })
705
+ }))
688
706
  }
689
707
 
690
708
  return this;
@@ -850,9 +868,13 @@ res.cookie = function (name, value, options) {
850
868
  val = 's:' + sign(val, secret);
851
869
  }
852
870
 
853
- if ('maxAge' in opts) {
854
- opts.expires = new Date(Date.now() + opts.maxAge);
855
- opts.maxAge /= 1000;
871
+ if (opts.maxAge != null) {
872
+ var maxAge = opts.maxAge - 0
873
+
874
+ if (!isNaN(maxAge)) {
875
+ opts.expires = new Date(Date.now() + maxAge)
876
+ opts.maxAge = Math.floor(maxAge / 1000)
877
+ }
856
878
  }
857
879
 
858
880
  if (opts.path == null) {
@@ -933,12 +955,12 @@ res.redirect = function redirect(url) {
933
955
  // Support text/{plain,html} by default
934
956
  this.format({
935
957
  text: function(){
936
- body = statuses[status] + '. Redirecting to ' + address
958
+ body = statuses.message[status] + '. Redirecting to ' + address
937
959
  },
938
960
 
939
961
  html: function(){
940
962
  var u = escapeHtml(address);
941
- body = '<p>' + statuses[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>'
963
+ body = '<p>' + statuses.message[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>'
942
964
  },
943
965
 
944
966
  default: function(){
@@ -1113,7 +1135,7 @@ function sendfile(res, file, options, callback) {
1113
1135
  * ability to escape characters that can trigger HTML sniffing.
1114
1136
  *
1115
1137
  * @param {*} value
1116
- * @param {function} replaces
1138
+ * @param {function} replacer
1117
1139
  * @param {number} spaces
1118
1140
  * @param {boolean} escape
1119
1141
  * @returns {string}
@@ -108,8 +108,8 @@ proto.param = function param(name, fn) {
108
108
  var ret;
109
109
 
110
110
  if (name[0] === ':') {
111
- deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.substr(1)) + ', fn) instead');
112
- name = name.substr(1);
111
+ deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.slice(1)) + ', fn) instead')
112
+ name = name.slice(1)
113
113
  }
114
114
 
115
115
  for (var i = 0; i < len; ++i) {
@@ -142,6 +142,7 @@ proto.handle = function handle(req, res, out) {
142
142
  var protohost = getProtohost(req.url) || ''
143
143
  var removed = '';
144
144
  var slashAdded = false;
145
+ var sync = 0
145
146
  var paramcalled = {};
146
147
 
147
148
  // store options for OPTIONS request
@@ -180,14 +181,14 @@ proto.handle = function handle(req, res, out) {
180
181
 
181
182
  // remove added slash
182
183
  if (slashAdded) {
183
- req.url = req.url.substr(1);
184
+ req.url = req.url.slice(1)
184
185
  slashAdded = false;
185
186
  }
186
187
 
187
188
  // restore altered req.url
188
189
  if (removed.length !== 0) {
189
190
  req.baseUrl = parentUrl;
190
- req.url = protohost + removed + req.url.substr(protohost.length);
191
+ req.url = protohost + removed + req.url.slice(protohost.length)
191
192
  removed = '';
192
193
  }
193
194
 
@@ -203,6 +204,11 @@ proto.handle = function handle(req, res, out) {
203
204
  return;
204
205
  }
205
206
 
207
+ // max sync stack
208
+ if (++sync > 100) {
209
+ return setImmediate(next, err)
210
+ }
211
+
206
212
  // get pathname of request
207
213
  var path = getPathname(req);
208
214
 
@@ -251,7 +257,6 @@ proto.handle = function handle(req, res, out) {
251
257
  // don't even bother matching route
252
258
  if (!has_method && method !== 'HEAD') {
253
259
  match = false;
254
- continue;
255
260
  }
256
261
  }
257
262
 
@@ -274,21 +279,21 @@ proto.handle = function handle(req, res, out) {
274
279
  // this should be done for the layer
275
280
  self.process_params(layer, paramcalled, req, res, function (err) {
276
281
  if (err) {
277
- return next(layerError || err);
278
- }
279
-
280
- if (route) {
281
- return layer.handle_request(req, res, next);
282
+ next(layerError || err)
283
+ } else if (route) {
284
+ layer.handle_request(req, res, next)
285
+ } else {
286
+ trim_prefix(layer, layerError, layerPath, path)
282
287
  }
283
288
 
284
- trim_prefix(layer, layerError, layerPath, path);
289
+ sync = 0
285
290
  });
286
291
  }
287
292
 
288
293
  function trim_prefix(layer, layerError, layerPath, path) {
289
294
  if (layerPath.length !== 0) {
290
295
  // Validate path is a prefix match
291
- if (layerPath !== path.substr(0, layerPath.length)) {
296
+ if (layerPath !== path.slice(0, layerPath.length)) {
292
297
  next(layerError)
293
298
  return
294
299
  }
@@ -301,7 +306,7 @@ proto.handle = function handle(req, res, out) {
301
306
  // middleware (.use stuff) needs to have the path stripped
302
307
  debug('trim prefix (%s) from url %s', layerPath, req.url);
303
308
  removed = layerPath;
304
- req.url = protohost + req.url.substr(protohost.length + removed.length);
309
+ req.url = protohost + req.url.slice(protohost.length + removed.length)
305
310
 
306
311
  // Ensure leading slash
307
312
  if (!protohost && req.url[0] !== '/') {
@@ -547,10 +552,10 @@ function getProtohost(url) {
547
552
  var pathLength = searchIndex !== -1
548
553
  ? searchIndex
549
554
  : url.length
550
- var fqdnIndex = url.substr(0, pathLength).indexOf('://')
555
+ var fqdnIndex = url.slice(0, pathLength).indexOf('://')
551
556
 
552
557
  return fqdnIndex !== -1
553
- ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))
558
+ ? url.substring(0, url.indexOf('/', 3 + fqdnIndex))
554
559
  : undefined
555
560
  }
556
561
 
@@ -98,6 +98,8 @@ Route.prototype._options = function _options() {
98
98
  Route.prototype.dispatch = function dispatch(req, res, done) {
99
99
  var idx = 0;
100
100
  var stack = this.stack;
101
+ var sync = 0
102
+
101
103
  if (stack.length === 0) {
102
104
  return done();
103
105
  }
@@ -127,6 +129,11 @@ Route.prototype.dispatch = function dispatch(req, res, done) {
127
129
  return done(err);
128
130
  }
129
131
 
132
+ // max sync stack
133
+ if (++sync > 100) {
134
+ return setImmediate(next, err)
135
+ }
136
+
130
137
  if (layer.method && layer.method !== method) {
131
138
  return next(err);
132
139
  }
@@ -136,6 +143,8 @@ Route.prototype.dispatch = function dispatch(req, res, done) {
136
143
  } else {
137
144
  layer.handle_request(req, res, next);
138
145
  }
146
+
147
+ sync = 0
139
148
  }
140
149
  };
141
150
 
@@ -120,6 +120,7 @@ exports.contentDisposition = deprecate.function(contentDisposition,
120
120
  * also includes `.originalIndex` for stable sorting
121
121
  *
122
122
  * @param {String} str
123
+ * @param {Number} index
123
124
  * @return {Object}
124
125
  * @api private
125
126
  */
@@ -74,7 +74,7 @@ function View(name, options) {
74
74
 
75
75
  if (!opts.engines[this.ext]) {
76
76
  // load engine
77
- var mod = this.ext.substr(1)
77
+ var mod = this.ext.slice(1)
78
78
  debug('require "%s"', mod)
79
79
 
80
80
  // default engine export