Error running `request({ uri: 'http:...' }).pipe(filed('/file'))` #12

indexzero opened this Issue Jan 12, 2012 · 0 comments

1 participant


There are a couple of problems here:

  • Since self.method is defined piping fails because the destination has no method .setHeader(). Looks like a miss on capability detection.
        self.dest.setHeader('content-type', self.mimetype)
TypeError: Cannot call method 'setHeader' of undefined
    at /a-project/node_modules/filed/main.js:87:19
    at Object.oncomplete (/a-project/node_modules/filed/main.js:152:7)
  • Even if that is fixed since the request method is not HEAD it will attempt to pipe to an undefined destination:
  dest.on('drain', ondrain);
TypeError: Cannot call method 'on' of undefined
    at [object Object].pipe (stream.js:52:8)
    at /a-project/node_modules/filed/main.js:111:42
    at Object.oncomplete (/a-project/node_modules/filed/main.js:154:7)

With both of those fixed I'm seeing empty files on disk. This may be a problem in some implementation on my end so I'm investigating further, but those two errors are definitely small bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment