Socket
Socket
Sign inDemoInstall

@hapi/hapi

Package Overview
Dependencies
Maintainers
7
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.0.0 to 20.0.1

3

lib/auth.js

@@ -395,4 +395,5 @@ 'use strict';

static async response(request) {
static async response(response) {
const request = response.request;
const auth = request._core.auth;

@@ -399,0 +400,0 @@ if (!request.auth.isAuthenticated) {

@@ -157,6 +157,6 @@ 'use strict';

exports.headers = function (request) {
exports.headers = function (response) {
const request = response.request;
const settings = request.route.settings.cors;
const response = request.response;

@@ -163,0 +163,0 @@ if (settings._origin !== false) {

@@ -12,5 +12,5 @@ 'use strict';

exports.cache = function (request) {
exports.cache = function (response) {
const response = request.response;
const request = response.request;
if (response.headers['cache-control']) {

@@ -36,5 +36,5 @@ return;

exports.content = async function (request) {
exports.content = async function (response) {
const response = request.response;
const request = response.request;
if (response._isPayloadSupported() ||

@@ -64,3 +64,3 @@ request.method === 'head') {

exports.type(request);
exports.type(response);
}

@@ -78,5 +78,5 @@ else {

exports.state = async function (request) {
exports.state = async function (response) {
const response = request.response;
const request = response.request;
const states = [];

@@ -125,5 +125,4 @@

exports.type = function (request) {
exports.type = function (response) {
const response = request.response;
const type = response.contentType;

@@ -136,4 +135,6 @@ if (type !== null && type !== response.headers['content-type']) {

exports.entity = function (request) {
exports.entity = function (response) {
const request = response.request;
if (!request._entity) {

@@ -143,4 +144,2 @@ return;

const response = request.response;
if (request._entity.etag &&

@@ -160,5 +159,5 @@ !response.headers.etag) {

exports.unmodified = function (request) {
exports.unmodified = function (response) {
const response = request.response;
const request = response.request;
if (response.statusCode === 304) {

@@ -165,0 +164,0 @@ return;

@@ -56,5 +56,4 @@ 'use strict';

exports.headers = function (request) {
exports.headers = function (response) {
const response = request.response;
const security = response.request.route.settings.security;

@@ -61,0 +60,0 @@

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

await internals.marshal(request);
await internals.marshal(response);
await internals.transmit(response);

@@ -39,6 +39,6 @@ }

internals.marshal = async function (request) {
internals.marshal = async function (response) {
for (const func of request._route._marshalCycle) {
await func(request);
for (const func of response.request._route._marshalCycle) {
await func(response);
}

@@ -54,3 +54,3 @@ };

try {
await internals.marshal(request);
await internals.marshal(response);
}

@@ -284,3 +284,3 @@ catch (err) {

if (request.raw.res.finished) {
if (event !== 'aborted') {
if (!event) {
request.info.responded = Date.now();

@@ -287,0 +287,0 @@ }

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

"homepage": "https://hapi.dev",
"version": "20.0.0",
"version": "20.0.1",
"repository": "git://github.com/hapijs/hapi",

@@ -48,3 +48,3 @@ "main": "lib/index.js",

"@hapi/vision": "^6.0.1",
"handlebars": "4.x.x",
"handlebars": "^4.5.3",
"joi": "17.x.x"

@@ -51,0 +51,0 @@ },

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

## The hapi project is changing direction... [Find out more](https://github.com/hapijs/hapi/issues/4111).
<img src="https://raw.githubusercontent.com/hapijs/assets/master/images/hapi.png" width="400px" />

@@ -4,0 +2,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