hapijs / hapijs/hapi

[multipart/form-data] Payload is parsed incorrectly

Open
#4,462 4 comments 0 reactions 0 assignees View on GitHub
support
Dominant language
JavaScript
Stars
14.8k
Forks
1.4k
Avg merge
22d 3h
Merged PRs (30d)
1

Description

#### Context

* *hapi version*: 20.3.0

#### How can we help?

I'm working with the multipart/form-data on hapi (version 20.3.0), the request payload is not parsed correctly for array and nested object.
Here is my request payload that i got

Screenshot 2023-10-03 at 12 40 27

My route
```js
server.route({
method: 'POST',
path: '/onboarding/{draft_id}',
options: {
handler: controller.create.bind(controller),
validate: {
// payload: createValidator,
failAction: (_, __, err) => badRequest(err.message),
},
payload: {
allow: 'multipart/form-data',
maxBytes: 20 * 1000 * 1000, // max payload to be 20MB in size.
multipart: {
output: 'data',
},
parse: true,
},
tags: [
'create-onboarding',
'onboarding',
],
description: 'Create Onboarding',
},
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.