Comparing version 4.0.0 to 4.0.1
@@ -91,7 +91,4 @@ 'use strict'; | ||
// FUTURE add header=present but wait for response on https://github.com/hapijs/hapi/issues/3243 | ||
// var response = reply(csv); | ||
// response.type(`${preferredType}; charset=${response.settings.charset}; header=present;`); | ||
return reply(csv).type(preferredType).header('content-disposition', 'attachment;'); | ||
const response = reply(csv); | ||
return response.type(`${preferredType}; charset=${response.settings.charset}; header=present;`).header('content-disposition', 'attachment;'); | ||
}); | ||
@@ -98,0 +95,0 @@ }); |
The MIT License (MIT) | ||
Copyright (c) 2015 Salesflare | ||
Copyright (c) 2018 Salesflare | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "hapi-csv", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Hapi plugin for converting a Joi response schema and dataset to csv", | ||
@@ -23,3 +23,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"async": "^2.6.0", | ||
"async": "^2.6.1", | ||
"hoek": "5.x.x" | ||
@@ -26,0 +26,0 @@ }, |
@@ -140,3 +140,3 @@ 'use strict'; | ||
expect(res.result).to.equal(userCSV); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -159,3 +159,3 @@ | ||
expect(res.result).to.equal(userCSV); | ||
expect(res.headers['content-type']).to.equal('application/csv'); | ||
expect(res.headers['content-type']).to.equal('application/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -175,3 +175,3 @@ | ||
expect(res.result).to.equal(userCSV); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -191,3 +191,3 @@ | ||
expect(res.result).to.equal(userCSV); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -300,3 +300,3 @@ expect(res.request.url.path).to.equal('/user?q=1'); | ||
expect(res.result).to.equal(postUserCSV); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -392,3 +392,3 @@ | ||
expect(res.result).to.equal(expectedResult); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -438,3 +438,3 @@ | ||
expect(res.result).to.equal(5); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -484,3 +484,3 @@ | ||
expect(res.result).to.equal('I said: ""Hello""'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -553,3 +553,3 @@ | ||
expect(res.result, 'result').to.equal(userCSV); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -631,3 +631,3 @@ | ||
expect(res.result, 'result').to.equal(userCSV); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -774,3 +774,3 @@ | ||
expect(res.result, 'result').to.equal(userCSV); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -843,3 +843,3 @@ | ||
expect(res.result, 'result').to.equal(userCSV); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8; header=present;'); | ||
expect(res.headers['content-disposition']).to.equal('attachment;'); | ||
@@ -846,0 +846,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
42032
0
873
Updatedasync@^2.6.1