express-csv icon indicating copy to clipboard operation
express-csv copied to clipboard

Bring up-to-date with Express 4.x

Open edu2004eu opened this issue 8 years ago • 1 comments

This package doesn't fully work with express 4.x (haven't tested other versions). More specifically, the sending of headers and status is not working, and deprecated respectively.

Fixing this is fairly easy:

Replace this.header('Content-Type', 'text/csv'); with this.set('Content-Type', 'text/csv'); and return this.send(body, headers, status); with:

this.set(headers);
return this.status(status).send(body);

edu2004eu avatar Jan 13 '16 14:01 edu2004eu

My fork of this should work as expected with express 4.x - https://www.npmjs.com/package/csv-express

jczaplew avatar May 24 '16 12:05 jczaplew