New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

baucis

Package Overview
Dependencies
Maintainers
1
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baucis - npm Package Compare versions

Comparing version 0.6.20 to 0.6.21

5

CHANGES.md
Baucis Change Log
=================
v0.6.21
-------
Fix an issue where the `Location` response header would be set incorrectly. Special thanks to feychenie.
v0.6.20

@@ -5,0 +10,0 @@ -------

7

middleware/documents.js

@@ -58,4 +58,9 @@ // __Dependencies__

// If it's not a POST, send now because Location shouldn't be set.
if (request.method !== 'POST') return response.json(documents);
if (request.method !== 'POST') return response.json(documents);
// Ensure there is a trailing slash on basePath for proper function of
// url.resolve, otherwise the model's plural will be missing in the location
// URL.
if(!basePath.match(/\/$/)) basePath += '/';
// Otherwise, set the location and send JSON document(s). Don't set location if documents

@@ -62,0 +67,0 @@ // don't have IDs for whatever reason e.g. custom middleware.

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/wprl/baucis",
"version": "0.6.20",
"version": "0.6.21",
"main": "index.js",

@@ -8,0 +8,0 @@ "scripts": {

@@ -1,2 +0,2 @@

baucis v0.6.20
baucis v0.6.21
==============

@@ -3,0 +3,0 @@

@@ -37,2 +37,18 @@ var expect = require('expect.js');

it('should correctly set location header when there is no trailing slash', function (done) {
var options = {
url: 'http://localhost:8012/api/v1/vegetables',
json: { name: 'Tomato' }
};
request.post(options, function (error, response, body) {
if (error) return done(error);
expect(response.statusCode).to.equal(201);
expect(body._id).not.to.be.empty();
expect(response.headers.location).to.equal('/api/v1/vegetables/' + body._id);
done();
});
});
it('should allow posting multiple documents at once', function (done) {

@@ -39,0 +55,0 @@ var options = {

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