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

Replace undici's multipart/form-data parser with custom implementation in tests #872

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

tokuhirom
Copy link
Member

Undici's multipart/form-data parser cannot handle Axios' multipart/form-data requests correctly. For example, see this failure: https:/line/line-bot-sdk-nodejs/actions/runs/9362094041/job/25770215937.

The root cause of this issue is unclear, but it exists in the legacy client code, which we plan to deprecate by the end of this year.

As a temporary workaround, we are replacing undici's parser with our own implementation to ensure the tests pass.

Changes:

  • Added a custom multipart/form-data parser function in test/client.spec.ts.
  • Updated tests to use the custom parser instead of undici's.

undici's parser can't parse axios' multipart/form-data request.
e.g. https:/line/line-bot-sdk-nodejs/actions/runs/9362094041/job/25770215937

I don't know about the root cause. But there's an issue in the legacy
client. And we plan to drop this code at the end of this year.

So, at this time, we'll replace the multipart/form-data parser with our
own code
@tokuhirom tokuhirom force-pushed the workaround-for-undici-issue branch from 8c73413 to 68f0ef9 Compare June 4, 2024 15:18
@tokuhirom tokuhirom merged commit a775036 into line:master Jun 5, 2024
3 checks passed
@tokuhirom tokuhirom deleted the workaround-for-undici-issue branch June 5, 2024 01:04
@Yang-33 Yang-33 mentioned this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants