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

@hapi/h2o2

Package Overview
Dependencies
Maintainers
6
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/h2o2 - npm Package Compare versions

Comparing version 9.1.0 to 10.0.0

25

lib/index.js

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

const Https = require('https');
const Url = require('url');

@@ -68,5 +69,4 @@ const Hoek = require('@hapi/hoek');

requirements: {
hapi: '>=19.0.0'
hapi: '>=20.0.0'
},
register: function (server, options) {

@@ -88,3 +88,3 @@

Hoek.assert(!route.settings.payload || ((route.settings.payload.output === 'data' || route.settings.payload.output === 'stream') && !route.settings.payload.parse), 'Cannot proxy if payload is parsed or if output is not stream or data');
settings.mapUri = handlerOptions.mapUri || internals.mapUri(handlerOptions.protocol, handlerOptions.host, handlerOptions.port, handlerOptions.uri);
settings.mapUri = handlerOptions.mapUri ?? internals.mapUri(handlerOptions.protocol, handlerOptions.host, handlerOptions.port, handlerOptions.uri);

@@ -164,3 +164,3 @@ if (settings.ttl === 'upstream') {

if (settings.downstreamResponseTime) {
downstreamStartTime = process.hrtime();
downstreamStartTime = process.hrtime.bigint();
}

@@ -182,4 +182,4 @@

if (settings.downstreamResponseTime) {
const downstreamResponseTime = process.hrtime(downstreamStartTime);
request.log(['h2o2', 'success'], { downstreamResponseTime: downstreamResponseTime[0] * internals.NS_PER_SEC + downstreamResponseTime[1] });
const downstreamResponseTime = Number(process.hrtime.bigint() - downstreamStartTime);
request.log(['h2o2', 'success'], { downstreamResponseTime });
}

@@ -189,4 +189,4 @@ }

if (settings.downstreamResponseTime) {
const downstreamResponseTime = process.hrtime(downstreamStartTime);
request.log(['h2o2', 'error'], { downstreamResponseTime: downstreamResponseTime[0] * internals.NS_PER_SEC + downstreamResponseTime[1] });
const downstreamResponseTime = Number(process.hrtime.bigint() - downstreamStartTime);
request.log(['h2o2', 'error'], { downstreamResponseTime });
}

@@ -254,3 +254,4 @@

.replace(/{port}/g, request.server.info.port)
.replace(/{path}/g, request.path);
.replace(/{path}/g, request.path)
.replace(/{query}/g, request.url.search || '');

@@ -275,6 +276,6 @@ Object.keys(request.params).forEach((key) => {

protocol = protocol || 'http:';
protocol = protocol ?? 'http:';
port = port || (protocol === 'http:' ? 80 : 443);
const baseUrl = protocol + '//' + host + ':' + port;
port = port ?? (protocol === 'http:' ? 80 : 443);
const baseUrl = Url.format({ protocol, hostname: host, port });

@@ -281,0 +282,0 @@ return function (request) {

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

Copyright (c) 2012-2020, Sideway Inc, and project contributors
Copyright (c) 2012-2014, Walmart.
Copyright (c) 2012-2022, Project contributors
Copyright (c) 2012-2020, Sideway Inc
Copyright (c) 2012-2014, Walmart.
All rights reserved.

@@ -4,0 +5,0 @@

{
"name": "@hapi/h2o2",
"description": "Proxy handler plugin for hapi.js",
"version": "9.1.0",
"version": "10.0.0",
"repository": "git://github.com/hapijs/h2o2",
"main": "lib/index.js",
"engines": {
"node": ">=12.0.0"
"node": ">=14.0.0"
},

@@ -20,14 +20,20 @@ "files": [

],
"eslintConfig": {
"extends": [
"plugin:@hapi/module"
]
},
"dependencies": {
"@hapi/boom": "9.x.x",
"@hapi/hoek": "9.x.x",
"@hapi/validate": "1.x.x",
"@hapi/wreck": "17.x.x"
"@hapi/boom": "^10.0.0",
"@hapi/hoek": "^10.0.0",
"@hapi/validate": "^2.0.0",
"@hapi/wreck": "^18.0.0"
},
"devDependencies": {
"@hapi/code": "8.x.x",
"@hapi/hapi": "20.x.x",
"@hapi/inert": "6.x.x",
"@hapi/lab": "24.x.x",
"@hapi/teamwork": "5.x.x"
"@hapi/code": "^9.0.0",
"@hapi/eslint-plugin": "^6.0.0",
"@hapi/hapi": "^21.0.0-beta.1",
"@hapi/inert": "^7.0.0",
"@hapi/lab": "^25.0.1",
"@hapi/teamwork": "^6.0.0"
},

@@ -34,0 +40,0 @@ "scripts": {

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