mjackson / strata

A modular, streaming HTTP server for node.js
http://stratajs.org
365 stars 35 forks source link

multipart and static middleware are incompatible #17

Closed wookiehangover closed 12 years ago

wookiehangover commented 12 years ago

If you use the static middleware in conjunction with an app that uses the multipart file upload middleware, all hell breaks loose. Here's a gist of the example from the docs, but with the static middleware added in: https://gist.github.com/1399257

That example will just hang when you try to upload a file.

In a more complex use case, I'm able to get a stacktrace (still haven't been able to track down why):

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: undefined is not a function
    at BufferedStream.<anonymous> (/Users/sam/dev/repos/cloudy/node_modules/strata/lib/request.js:521:30)
    at BufferedStream.emit (events.js:67:17)
    at BufferedStream.flush (/Users/sam/dev/repos/cloudy/node_modules/strata/node_modules/bufferedstream/bufferedstream.js:151:18)
    at Array.tick [as 0] (/Users/sam/dev/repos/cloudy/node_modules/strata/node_modules/bufferedstream/bufferedstream.js:115:18)
    at EventEmitter._tickCallback (node.js:192:40)

Thanks!