ultimate-express 1.3.5 → 1.3.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-express",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "The Ultimate Express. Fastest http server with full Express compatibility, based on uWebSockets.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  "dev": "node --inspect=9229 demo/index.js"
9
9
  },
10
10
  "engines": {
11
- "node": ">=16"
11
+ "node": ">=18"
12
12
  },
13
13
  "files": [
14
14
  "src",
@@ -80,6 +80,7 @@
80
80
  "express-rate-limit": "^7.4.0",
81
81
  "express-session": "^1.18.0",
82
82
  "express-subdomain": "^1.0.6",
83
+ "formdata-node": "^6.0.3",
83
84
  "method-override": "^3.0.0",
84
85
  "multer": "^1.4.5-lts.1",
85
86
  "mustache-express": "^1.3.2",
@@ -144,11 +144,8 @@ function createBodyParser(defaultType, beforeReturn) {
144
144
  if(typeof options.limit === 'undefined') options.limit = bytes('100kb');
145
145
  else options.limit = bytes(options.limit);
146
146
 
147
- if(typeof options.type === 'undefined') options.type = defaultType;
148
- else if(typeof options.type !== 'string') {
149
- throw new Error('type must be a string');
150
- }
151
147
  if(typeof options.inflate === 'undefined') options.inflate = true;
148
+ if(typeof options.type === 'undefined') options.type = defaultType;
152
149
  if(typeof options.type === 'string') {
153
150
  if(!options.type.includes("*")) {
154
151
  options.simpleType = options.type;
@@ -234,7 +231,10 @@ function createBodyParser(defaultType, beforeReturn) {
234
231
  if(inflate) {
235
232
  buf = inflate.process(buf);
236
233
  }
237
- abs.push(buf);
234
+
235
+ // shallow copy, to avoid shared references for large bodies.
236
+ abs.push(Buffer.from(buf));
237
+
238
238
  totalSize += buf.length;
239
239
  if(totalSize > options.limit) {
240
240
  return next(new Error('Request entity too large'));