Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-csv

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-csv - npm Package Compare versions

Comparing version 2.3.2 to 2.4.0

2

lib/index.js

@@ -72,3 +72,3 @@ 'use strict';

return reply(csv).type(preferedType);
return reply(csv).type(preferedType).header('content-disposition', 'attachment;');
}

@@ -75,0 +75,0 @@

{
"name": "hapi-csv",
"version": "2.3.2",
"version": "2.4.0",
"description": "Hapi plugin for converting a Joi response schema and dataset to csv",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -49,1 +49,3 @@ # Hapi-csv [![Build Status](https://travis-ci.org/Salesflare/hapi-csv.svg?branch=master)](https://travis-ci.org/Salesflare/hapi-csv)

The header approach is prefered.
Currently the `content-disposition` header is set to `attachment;` by default since this plugin is intended for exporting purposes, if this hinders you just let us know.

@@ -121,2 +121,3 @@ 'use strict';

expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8');
expect(res.headers['content-disposition']).to.equal('attachment;');

@@ -139,2 +140,3 @@ return done();

expect(res.headers['content-type']).to.equal('application/csv');
expect(res.headers['content-disposition']).to.equal('attachment;');

@@ -154,2 +156,3 @@ return done();

expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8');
expect(res.headers['content-disposition']).to.equal('attachment;');

@@ -169,2 +172,3 @@ return done();

expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8');
expect(res.headers['content-disposition']).to.equal('attachment;');
expect(res.request.url.path).to.equal('/user?q=1');

@@ -330,2 +334,4 @@

expect(res.result).to.equal(expectedResult);
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8');
expect(res.headers['content-disposition']).to.equal('attachment;');

@@ -374,2 +380,4 @@ return server.stop(done);

expect(res.result).to.equal(5);
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8');
expect(res.headers['content-disposition']).to.equal('attachment;');

@@ -441,2 +449,4 @@ return server.stop(done);

expect(res.result, 'result').to.equal(userCSV);
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8');
expect(res.headers['content-disposition']).to.equal('attachment;');

@@ -443,0 +453,0 @@ return server.stop(done);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc