Skip to content

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

@indexzero

Description

@indexzero

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.
/a-project/node_modules/filed/main.js:87
        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:
stream.js:52
  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions