felixge/node-formidable — pull request #120 by bcherry (2011-12-30 21:01:23+00:00)
Title: Ignore leading CR/LF characters in multipart body

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: https://github.com/AFNetworking/AFNetworking/pull/134

Thanks!