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

Why is parts empty? #34

Open
cawoodm opened this issue Dec 15, 2022 · 2 comments
Open

Why is parts empty? #34

cawoodm opened this issue Dec 15, 2022 · 2 comments

Comments

@cawoodm
Copy link

cawoodm commented Dec 15, 2022

var multipart = require('parse-multipart');
let boundary = "abcde12345"
let body = `--abcde12345\r\nContent-Disposition: form-data; name="id"\r\nContent-Type: text/plain\r\nfoo\r\n--abcde12345--`
var parts = multipart.Parse(body, boundary);
console.log(parts);

Why is parts empty?

@cawoodm
Copy link
Author

cawoodm commented Dec 16, 2022

Tried with extra newline before foo:

var multipart = require('parse-multipart');
let boundary = "abcde12345"
let body = `--abcde12345\r\nContent-Disposition: form-data; name="id"\r\nContent-Type: text/plain\r\n\r\nfoo\r\n--abcde12345--\r\n`
var parts = multipart.Parse(body, boundary);
console.log(parts);

Still empty.

The request body is:

--abcde12345
Content-Disposition: form-data; name="id"
Content-Type: text/plain

foo
--abcde12345--

@vovaoecoyc
Copy link

Did somebody find the solution?

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