Skip to content

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