coolaj86 / formaline

formaline is a module for handling form requests ( HTTP POSTs / PUTs ) and for fast parsing of file uploads.
Apache License 2.0
239 stars 16 forks source link

getSessionID config function not optional? #16

Closed kevwil closed 13 years ago

kevwil commented 13 years ago

I've posted my formaline code snippet from an express.js app, and the resulting output.

https://gist.github.com/1140111

If I understand the Readme.md doc correctly, the getSessionID value of config should default to null if not supplied, but my error message is complaining that the value must be a function. What have I done wrong?

My express.js app doesn't use sessions, so I would rather not add sessions just so I can wire up this function. I've looked at http://expressjs.com/guide.html#session-support and don't see anything about a SessionID anyway, so I don't know how I would wire the two together.

rootslab commented 13 years ago

Hi Kevin!

About the warning, it's only a warning! :) nothing important! You can disable debug (off) to not see this kind of messages.

About the SessionID, you can simply avoid to define getSessionId in your config object, however if you want to use a single upload directory ( for an authenticated user), probably you will need it, note that you could return any value you want , it's your choice !

About the Bug, seems that request was complete without receiving a first chunk of data. It is a kind of weird behaviour!

If you need further investigation about it, you could turn on all debug switches in your config object, replay a request that produces error and send me the zipped directory with all logs, and possibly the files.

It would be great!

rootslab commented 13 years ago

I have modified a little the code for handling this situation without exceptions. Try it, now your request will get in timeout state, I think. I'll wait to hear from you ;)

kevwil commented 13 years ago

I can't share any more code than I have, due to Intellectual Property restrictions, so I'm not sure how I can help troubleshoot this.

I tried the latest code and didn't notice any difference.

The root of the problem seems to be that the first part in the multipart body is empty. I've tried an html form using Safari, Firefox and Chrome, as well as a curl call, and I even tried both HTTP/1.1 and HTTP/1.0 with curl, and the request seems to always be the same. I've had similar problems with node-formidable. But this theory could just be a trick of my frustrated mind. Four different user agents, two different multipart parsers, nothing works.

This is all on Mac OS X 10.6.8, by the way.

rootslab commented 13 years ago

I don't want your code files, only the request recording.. anyway, have you tried the simple example? I think you are using a middleware, your request was totally received and parsed before formaline access it. Can you post a request to formaline and send me the recordings? Otherwise I can't help you! Thanks..