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

Making a multipart request breaks inside the request module #288

Open
ruspaull opened this issue Aug 21, 2019 · 2 comments
Open

Making a multipart request breaks inside the request module #288

ruspaull opened this issue Aug 21, 2019 · 2 comments

Comments

@ruspaull
Copy link

ruspaull commented Aug 21, 2019

When trying to send a multipart request using the following parameters: { form: true }, it will throw an error in the underlying request module.
However, it will work properly if you use { form: {} }.
This is because when you construct the underlying request, you assign to the form property the true value and the request module does not like that.

await icedFrisby.create('Upload file - ${fileName}').post(url, { data: { value: content, options: { filename: fileName }}}, { form: true }).expectStatus(200).run();

Error: MultipartParser.end(): stream ended unexpectedly: state = HEADER_FIELD at MultipartParser.end (node_modules\\formidable\\lib\\multipart_parser.js:326:12)

If needed I can provide a repo to reproduce the issue.

@paulmelnikow
Copy link
Collaborator

Hi! Thanks for the report!

Would you like to add a test and a fix?

@ruspaull
Copy link
Author

ruspaull commented Aug 21, 2019

Sure, I can give it a try :)

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

No branches or pull requests

2 participants