Comparing version 0.18.0 to 0.18.1
@@ -181,5 +181,8 @@ // __Dependencies__ | ||
api.parser = function (mime) { | ||
// Default to JSON when no MIME type is provided. | ||
mime = mime || 'application/json'; | ||
// Not interested in any additional parameters at this point. | ||
mime = mime.split(';')[0].trim(); | ||
var handler = parsers[mime]; | ||
return handler ? handler() : false; | ||
return handler ? handler() : undefined; | ||
}; | ||
@@ -186,0 +189,0 @@ |
Baucis Change Log | ||
================= | ||
v0.18.1 | ||
------- | ||
Fix an issue where the request's content type would not be recognized when it used a MIME type parameter. (#152) | ||
v0.18.0 | ||
@@ -5,0 +9,0 @@ ------- |
@@ -87,3 +87,3 @@ // __Dependencies__ | ||
request.baucis.send, | ||
lastModified(response, controller.get('lastModified')), | ||
lastModified(response, controller.get('lastModified')), // TODO Only add if enabled | ||
es.stringify(), | ||
@@ -108,3 +108,3 @@ etag(response), | ||
request.baucis.send, | ||
lastModified(response, controller.get('lastModified')), | ||
lastModified(response, controller.get('lastModified')), // TODO only add if enabled | ||
etag(response), | ||
@@ -111,0 +111,0 @@ request.baucis.formatter() |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/wprl/baucis", | ||
"version": "0.18.0", | ||
"version": "0.18.1", | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
baucis v0.18.0 | ||
baucis v0.18.1 | ||
============== | ||
@@ -3,0 +3,0 @@ |
@@ -62,2 +62,17 @@ var expect = require('expect.js'); | ||
it('should match the correct MIME type, ignoring extra options and linear whitespace', function (done) { | ||
var options = { | ||
url: 'http://localhost:8012/api/vegetables', | ||
headers: { | ||
'Content-Type': ' application/json ; charset=UTF-8 cheese=roquefort ' | ||
}, | ||
json: { name: 'Tomatillo' } | ||
}; | ||
request.post(options, function (error, response, body) { | ||
if (error) return done(error); | ||
expect(response.statusCode).to.be(201); | ||
done(); | ||
}); | ||
}); | ||
it('should set X-Powered-By', function (done) { | ||
@@ -64,0 +79,0 @@ var options = { |
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
330849
4165