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

feat: add optional charset option to multipart body parser #934

Merged
merged 5 commits into from
Nov 13, 2022
Merged

feat: add optional charset option to multipart body parser #934

merged 5 commits into from
Nov 13, 2022

Conversation

salesh
Copy link
Contributor

@salesh salesh commented Nov 12, 2022

Related to #932

This seemed like something I could contribute to, please let me know if I missed anything

const response = await handler(event, defaultContext)

t.deepEqual(response, { PartName: '{"foo":"bar–"}' })
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test was completely wrong, I am trying to figure out more correct example - any help would be appreciated

@willfarrell
Copy link
Member

Thanks for the PR. A test when binary is passed in will be needed. See the v2 branch when binary was the default for a test that can be copied in. https://github.com/middyjs/middy/blob/2.x/packages/http-multipart-body-parser/__tests__/index.js

@salesh
Copy link
Contributor Author

salesh commented Nov 12, 2022

Thanks for the PR. A test when binary is passed in will be needed. See the v2 branch when binary was the default for a test that can be copied in. https://github.com/middyjs/middy/blob/2.x/packages/http-multipart-body-parser/__tests__/index.js

That test has an issue

  It should parse an array from a multipart/form-data request (binary)

  Rejected promise returned by test. Reason:

  UnprocessableEntityError (HttpError) {
    expose: true,
    status: 422,
    statusCode: 422,
    message: 'Invalid or malformed multipart/form-data was provided',
  }

how I understand it - an empty body is the root of the issue for that one

@willfarrell willfarrell merged commit e37a490 into middyjs:feature/4.0 Nov 13, 2022
@salesh salesh deleted the feature/multipart-body-parser-optional-charset branch November 14, 2022 17:15
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