Skip to content

multipart_parser appears to mis-handle some specific content #2

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

Closed
kristsk opened this issue Jun 21, 2010 · 4 comments
Closed

multipart_parser appears to mis-handle some specific content #2

kristsk opened this issue Jun 21, 2010 · 4 comments

Comments

@kristsk
Copy link

kristsk commented Jun 21, 2010

formidable dies with -

listening on http://localhost:8001/
events:11
throw arguments[1];
                   ^
Error: MultipartParser.end(): stream ended unexpectedly
at MultipartParser.end (/home/k/chowder/lib/formidable-vanilla/lib/formidable/multipart_parser.js:299:12)
at IncomingMessage.<anonymous> (/home/k/chowder/lib/formidable-vanilla/lib/formidable/incoming_form.js:64:30)
at IncomingMessage.emit (events:25:26)
at HTTPParser.onMessageComplete (http:110:23)
at Stream.ondata (http:745:22)
at IOWatcher.callback (net:373:31)
at node.js:204:9

when trying to upload this file using examples/upload.js - http://www.robgalbraith.com/public_files/EOS-1D_Mark_III_C.Fn_I-II.pdf

@felixge
Copy link
Collaborator

felixge commented Jun 21, 2010

Very interesting, I'm glad you found this.

I just had a few minutes to look into right now, but i seems that either node.js or the browser are doing something wrong here. By that I mean that the last package I received from the requests 'data' event does not contain the final boundary.

I'll look more into this tomorrow!

@kristsk
Copy link
Author

kristsk commented Jun 21, 2010

I did a little late night digging and found out that upload appears to fail if uploaded file ends with odd number of newlines (even is fine). Reason for this behaviour escapes me right now.

@felixge
Copy link
Collaborator

felixge commented Jun 22, 2010

Ok, I got confused last night. This is an issue with the parser, and this commit should fix it:

7429179

Let me know if this works for you!

@kristsk
Copy link
Author

kristsk commented Jun 22, 2010

Looks like it works propperly now. Thanks.

This issue was closed.
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