freesoftwarefactory / parse-multipart

A javascript/nodejs multipart/form-data parser which operates on raw data.
MIT License
48 stars 80 forks source link

Boundary Bugfix #5

Closed rcfrias closed 7 years ago

rcfrias commented 7 years ago

Additional hyphens never fulfill conditional.

rcfrias commented 7 years ago

Applied to DemoData, but not to real data. Still on test. *update: nevermind, this could be my error, I was testing with a hardcoded boundary: var boundary = "------WebKitFormBoundaryvef1fLxmoUdYZWXp";

And on the real side like this: const { headers } = req; const contentType = headers['content-type']; var boundary = multipart.getBoundary(contentType);

I just didn't know how to simulate the headers part in the demo Data, I am sure removing two hyphens from the hardcoded string would work.

christiansalazar commented 7 years ago

thanku very much. will test your PR soon (using the demo payload). :)