Skip to content

Commit 8310913

Browse files
committed
Support pez maxBytes option
1 parent 8d7aeaa commit 8310913

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

API.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Parses the request body and returns it in a promise.
3232
- `parse`: (required) boolean
3333
- `output`: (required) 'data', 'stream', 'file'
3434
- `maxBytes`: int
35+
- `maxParts`: int
3536
- `override`: string
3637
- `defaultContentType`: string
3738
- `allow`: string, only allow a certain media type

lib/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ internals.multipart = function (req, options, source, contentType) {
231231

232232
// Create parser
233233

234-
const dispenserOptions = Hoek.applyToDefaults(contentType, { maxBytes: options.maxBytes });
234+
const dispenserOptions = Hoek.applyToDefaults(contentType, {
235+
maxBytes: options.maxBytes,
236+
maxParts: options.maxParts
237+
});
235238
const dispenser = new Pez.Dispenser(dispenserOptions);
236239

237240
const data = {};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@hapi/content": "^6.0.0",
2626
"@hapi/file": "^3.0.0",
2727
"@hapi/hoek": "^11.0.2",
28-
"@hapi/pez": "^6.0.1",
28+
"@hapi/pez": "^6.1.0",
2929
"@hapi/wreck": "^18.0.1"
3030
},
3131
"devDependencies": {

0 commit comments

Comments
 (0)