Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[http-multipart-body-parser] Parse array from multipart form data #521

Merged
merged 1 commit into from
Jul 24, 2020

Conversation

benjifs
Copy link
Contributor

@benjifs benjifs commented May 21, 2020

What does this implement/fix? Explain your changes.

When receiving formdata with an array (eg. checkboxes), only the last value is used. A simple way to test is by trying out the following:

curl -X POST -F 'foo[]=one' -F 'foo[]=two' http://localhost

Currently this would parse as

'foo[]': 'two'

With this change, the result is:

'foo': [ 'one', 'two' ]

Does this close any currently open issues?

No

Any relevant logs, error output, etc?

n/a

Any other comments?

I originally created #508 but rebasing was causing some issues on my end. Made a clean branch and put the changes here instead.

Where has this been tested?

Node.js Versions: 13.12.0

Middy Versions: 1.0.0

AWS SDK Versions: n/a

Todo list

[x] Feature/Fix fully implemented
[x] Added tests
[ ] Updated relevant documentation
[ ] Updated relevant examples

@benjifs benjifs changed the title feat: parse array from multipart form data [http-multipart-body-parser] Parse array from multipart form data May 21, 2020
@willfarrell willfarrell merged commit 098fd25 into middyjs:master Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants