Comparing version 2.3.0 to 2.3.1
@@ -40,3 +40,3 @@ 'use strict'; | ||
request.setUrl(path.substring(0, path.length - 4)); | ||
request.setUrl(`${path.substring(0, path.length - 4)}${request.url.search}`); | ||
request.headers.accept = 'text/csv'; | ||
@@ -43,0 +43,0 @@ } |
{ | ||
"name": "hapi-csv", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Hapi plugin for converting a Joi response schema and dataset to csv", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -148,2 +148,17 @@ 'use strict'; | ||
it('Converts when route ends with .csv and has query params', (done) => { | ||
return simpleServer.inject({ | ||
method: 'GET', | ||
url: '/user.csv?q=1' | ||
}, (res) => { | ||
expect(res.result).to.equal(userCSV); | ||
expect(res.headers['content-type']).to.equal('text/csv; charset=utf-8'); | ||
expect(res.request.url.path).to.equal('/user?q=1'); | ||
return done(); | ||
}); | ||
}); | ||
it('Still replies with JSON when asked', (done) => { | ||
@@ -150,0 +165,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
23346
485