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

hapi

Package Overview
Dependencies
Maintainers
1
Versions
295
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi - npm Package Compare versions

Comparing version 13.3.0 to 13.4.0

0

lib/connection.js

@@ -0,0 +0,0 @@ 'use strict';

2

lib/route.js

@@ -268,3 +268,3 @@ 'use strict';

// Builde lifecycle array
// Build lifecycle array

@@ -271,0 +271,0 @@ const cycle = [];

@@ -0,0 +0,0 @@ 'use strict';

@@ -83,3 +83,3 @@ 'use strict';

const error = Boom.badRequest(err.message, err);
const error = (err.isBoom ? err : Boom.badRequest(err.message, err));
error.output.payload.validation = { source: source, keys: [] };

@@ -86,0 +86,0 @@ if (err.details) {

{
"name": "hapi",
"version": "13.2.2",
"version": "13.4.0",
"dependencies": {
"accept": {
"version": "2.1.0"
"version": "2.1.1"
},

@@ -12,3 +12,3 @@ "ammo": {

"boom": {
"version": "3.1.2"
"version": "3.1.3"
},

@@ -28,6 +28,6 @@ "call": {

"heavy": {
"version": "4.0.0"
"version": "4.0.1"
},
"hoek": {
"version": "3.0.4"
"version": "4.0.0"
},

@@ -38,6 +38,6 @@ "iron": {

"items": {
"version": "2.0.0"
"version": "2.1.0"
},
"joi": {
"version": "8.0.4",
"version": "8.1.0",
"dependencies": {

@@ -48,3 +48,3 @@ "isemail": {

"moment": {
"version": "2.12.0"
"version": "2.13.0"
}

@@ -60,3 +60,3 @@ }

"mime-db": {
"version": "1.22.0"
"version": "1.23.0"
}

@@ -75,9 +75,9 @@ }

"subtext": {
"version": "4.0.0",
"version": "4.0.1",
"dependencies": {
"content": {
"version": "3.0.0"
"version": "3.0.1"
},
"pez": {
"version": "2.0.1",
"version": "2.1.0",
"dependencies": {

@@ -91,3 +91,3 @@ "b64": {

"vise": {
"version": "2.0.0"
"version": "2.0.1"
}

@@ -99,3 +99,3 @@ }

"wreck": {
"version": "7.0.2"
"version": "7.2.0"
}

@@ -102,0 +102,0 @@ }

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

"homepage": "http://hapijs.com",
"version": "13.3.0",
"version": "13.4.0",
"repository": {

@@ -30,3 +30,3 @@ "type": "git",

"heavy": "4.x.x",
"hoek": "3.x.x",
"hoek": "4.x.x",
"iron": "4.x.x",

@@ -33,0 +33,0 @@ "items": "2.x.x",

@@ -15,3 +15,3 @@ <img src="https://raw.github.com/hapijs/hapi/master/images/hapi.png" />

Development version: **13.2.x** ([release notes](https://github.com/hapijs/hapi/issues?labels=release+notes&page=1&state=closed))
Development version: **13.4.x** ([release notes](https://github.com/hapijs/hapi/issues?labels=release+notes&page=1&state=closed))
[![Build Status](https://secure.travis-ci.org/hapijs/hapi.svg)](http://travis-ci.org/hapijs/hapi)

@@ -18,0 +18,0 @@

@@ -684,2 +684,49 @@ 'use strict';

});
it('errors if multipart payload exceeds byte limit', (done) => {
const multipartPayload =
'--AaB03x\r\n' +
'content-disposition: form-data; name="x"\r\n' +
'\r\n' +
'First\r\n' +
'--AaB03x\r\n' +
'content-disposition: form-data; name="x"\r\n' +
'\r\n' +
'Second\r\n' +
'--AaB03x\r\n' +
'content-disposition: form-data; name="x"\r\n' +
'\r\n' +
'Third\r\n' +
'--AaB03x\r\n' +
'content-disposition: form-data; name="field1"\r\n' +
'\r\n' +
'Joe Blow\r\nalmost tricked you!\r\n' +
'--AaB03x\r\n' +
'content-disposition: form-data; name="field1"\r\n' +
'\r\n' +
'Repeated name segment\r\n' +
'--AaB03x\r\n' +
'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n' +
'Content-Type: text/plain\r\n' +
'\r\n' +
'... contents of file1.txt ...\r\r\n' +
'--AaB03x--\r\n';
const handler = function (request, reply) {
return reply('result');
};
const server = new Hapi.Server();
server.connection();
server.route({ method: 'POST', path: '/echo', config: { handler: handler, payload: { output: 'data', parse: true, maxBytes: 5 } } });
server.inject({ method: 'POST', url: '/echo', payload: multipartPayload, simulate: { split: true }, headers: { 'content-length': null, 'content-type': 'multipart/form-data; boundary=AaB03x' } }, (res) => {
expect(res.statusCode).to.equal(400);
expect(res.payload.toString()).to.equal('{"statusCode":400,"error":"Bad Request","message":"Invalid multipart payload format"}');
done();
});
});
});

@@ -119,2 +119,22 @@ 'use strict';

it('ignores invalid cookie using server.state() (header)', (done) => {
const handler = function (request, reply) {
const log = request.getLog('state');
return reply(log.length);
};
const server = new Hapi.Server();
server.connection();
server.state('a', { strictHeader: false });
server.route({ path: '/', method: 'GET', handler: handler });
server.inject({ method: 'GET', url: '/', headers: { cookie: 'a=x y;' } }, (res) => {
expect(res.statusCode).to.equal(200);
expect(res.result).to.equal(0);
done();
});
});
it('logs invalid cookie (value)', (done) => {

@@ -121,0 +141,0 @@

@@ -218,2 +218,29 @@ 'use strict';

it('retains custom validation error', (done) => {
const server = new Hapi.Server();
server.connection();
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
return reply('ok');
},
config: {
validate: {
query: {
a: Joi.number().error(Boom.forbidden())
}
}
}
});
server.inject('/?a=abc', (res) => {
expect(res.statusCode).to.equal(403);
done();
});
});
it('validates valid input with validation options', (done) => {

@@ -220,0 +247,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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