Comparing version 2.3.2 to 2.4.0
@@ -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); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25458
524
51