Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bananas

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bananas - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

4

lib/index.js

@@ -98,3 +98,5 @@ 'use strict';

if (settings.exclude.indexOf(request.path) !== -1) {
const routeSettings = request.route.settings.plugins.bananas || {};
if (settings.exclude.indexOf(request.path) !== -1 || routeSettings.exclude) {
return;

@@ -101,0 +103,0 @@ }

{
"name": "bananas",
"description": "Minimal Loggly hapi plugin",
"version": "1.5.0",
"version": "1.6.0",
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "repository": "git://github.com/hueniverse/bananas",

@@ -253,2 +253,63 @@ 'use strict';

it('filter routes with flag', { parallel: false }, (done) => {
const server = new Hapi.Server({ debug: false });
server.connection();
const settings = {
token: 'abcdefg',
intervalMsec: 50,
exclude: ['/b']
};
let updates = [];
const orig = Wreck.post;
Wreck.post = function (uri, options, next) {
updates = updates.concat(options.payload.split('\n'));
return next();
};
server.register({ register: Bananas, options: settings }, (err) => {
expect(err).to.not.exist();
server.route({
path: '/a',
method: 'GET',
handler: function (request, reply) {
return reply('hello');
},
config: {
plugins: {
bananas: {
exclude: true
}
}
}
});
server.start((err) => {
expect(err).to.not.exist();
server.inject('/a', (res1) => {
setTimeout(() => {
expect(updates.length).to.equal(1);
Wreck.post = orig;
server.stop((err) => {
expect(err).to.not.exist();
done();
});
}, 200);
});
});
});
});
it('logs uncaughtException event', { parallel: false }, (done) => {

@@ -255,0 +316,0 @@

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