Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Ignore leading CR/LF characters in multipart body #120

merged 1 commit into from Oct 12, 2012


None yet
6 participants

bcherry commented Dec 30, 2011

Hey there!

I've encountered a fatal bug in the multipart parser when a client submits a slightly malformed request. If the request begins with a new line, rather than beginning with the first boundary, the node-formidable parser will reject it and throw the 'parser error - 0 of X bytes parsed' error. This is simple enough to patch that I think it warrants inclusion.

The iOS library AFNetworking used to send this sort of request, although they've fixed it recently: AFNetworking/AFNetworking#134


This also fixes problems with multipart uploads from unity3d.

This fix is magic, thanks. Is there a proper way to get this fix? I am using formidable within express - I change this section of code and it works, but how am I supposed to maintain that if I do an npm install? please excuse my ignorance. :)

This is great, totally solves posting binary data to an express/node server from Unity 3D's WWW class. Thanks


felixge, please merge this asap.

svnlto added a commit that referenced this pull request Oct 12, 2012

Merge pull request #120 from bcherry/multipart-leading-crlf
Ignore leading CR/LF characters in multipart body

@svnlto svnlto merged commit b44d5a4 into felixge:master Oct 12, 2012

svnlto commented on 6715425 Oct 12, 2012

If you could provide a test for this I'd merge it into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment