Skip to content

Commit

Permalink
Support pez maxBytes option
Browse files Browse the repository at this point in the history
  • Loading branch information
devinivy committed Feb 14, 2023
1 parent f797389 commit 0a20f7e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Parses the request body and returns it in a promise.
- `parse`: (required) boolean
- `output`: (required) 'data', 'stream', 'file'
- `maxBytes`: int
- `maxParts`: int
- `override`: string
- `defaultContentType`: string
- `allow`: string, only allow a certain media type
Expand Down
5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ internals.multipart = function (req, options, source, contentType) {

// Create parser

const dispenserOptions = Hoek.applyToDefaults(contentType, { maxBytes: options.maxBytes });
const dispenserOptions = Hoek.applyToDefaults(contentType, {
maxBytes: options.maxBytes,
maxParts: options.maxParts
});
const dispenser = new Pez.Dispenser(dispenserOptions);

const data = {};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@hapi/content": "^5.0.2",
"@hapi/file": "2.x.x",
"@hapi/hoek": "9.x.x",
"@hapi/pez": "^5.0.1",
"@hapi/pez": "^5.1.0",
"@hapi/wreck": "17.x.x"
},
"devDependencies": {
Expand Down

0 comments on commit 0a20f7e

Please sign in to comment.