Socket
Socket
Sign inDemoInstall

@hapi/hapi

Package Overview
Dependencies
Maintainers
6
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/hapi - npm Package Compare versions

Comparing version 20.1.3 to 20.1.4

19

lib/response.js

@@ -58,6 +58,7 @@ 'use strict';

this._payload = null; // Readable stream
this._error = null; // The boom object when created from an error (used for logging)
this._error = options.error || null; // The boom object when created from an error (used for logging)
this._contentType = null; // Used if no explicit content-type is set and type is known
this._takeover = false;
this._statusCode = false; // true when code() called
this._state = this._error ? 'prepare' : 'init'; // One of 'init', 'prepare', 'marshall', 'close'

@@ -499,2 +500,6 @@ this._processors = {

Hoek.assert(this._state === 'init');
this._state = 'prepare';
this._passThrough();

@@ -563,6 +568,10 @@

let source = this.source;
Hoek.assert(this._state === 'prepare');
this._state = 'marshall';
// Processor marshal
let source = this.source;
if (this._processors.marshal) {

@@ -644,2 +653,8 @@ try {

if (this._state === 'close') {
return;
}
this._state = 'close';
if (this._processors.close) {

@@ -646,0 +661,0 @@ try {

2

lib/toolkit.js

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

response = request._core.Response.wrap(response, request);
if (!response.isBoom) {
if (!response.isBoom && response._state === 'init') {
response = await response._prepare();

@@ -107,0 +107,0 @@ }

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

for (const func of response.request._route._marshalCycle) {
await func(response);
if (response._state !== 'close') {
await func(response);
}
}

@@ -76,4 +78,3 @@ };

const error = boom.output;
const response = new request._core.Response(error.payload, request);
response._error = boom;
const response = new request._core.Response(error.payload, request, { error: boom });
response.code(error.statusCode);

@@ -80,0 +81,0 @@ response.headers = Hoek.clone(error.headers); // Prevent source from being modified

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

"homepage": "https://hapi.dev",
"version": "20.1.3",
"version": "20.1.4",
"repository": "git://github.com/hapijs/hapi",

@@ -8,0 +8,0 @@ "main": "lib/index.js",

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