You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to serve encrypted files with res.sendFile().
Maybe by passing a decrypting stream via opts, that is piped along with the file contents?
Thanks.
The text was updated successfully, but these errors were encountered:
Hi! Would you be willing to flesh out the proposal a bit more so we can understand what would need to be implemented to support your use-case? You're also definitely welcome to start up a PR even if it's incomplete if that is a more preferred way to start on a proposal (code vs words) :)
I'd like to use res.sendFile() and pass a transforming stream, that decrypts the files.
var decrypt = crypto.createCipher(algorithm, password);
var opts = {
transform: function(stream) {
return stream.pipe(decrypt);
}
}
res.sendFile(path, opts, cb);
I've tried implementing this in an Express PR.
Realised Express uses pillarjs/send for the file streaming.
So, support for transforming streams would first need to land in pillarjs/send. Noticed one open PR exists on the subject.
Options already are passed through, so no change required in Express.
I'd like to be able to serve encrypted files with res.sendFile().
Maybe by passing a decrypting stream via opts, that is piped along with the file contents?
Thanks.
The text was updated successfully, but these errors were encountered: