Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@hapi/shot

Package Overview
Dependencies
3
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.5 to 6.0.0-beta.0

17

lib/request.js

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

super({
emitClose: !!(options.simulate && options.simulate.close),
emitClose: !!(options.simulate?.close),
autoDestroy: true // This is the default in node 14+

@@ -36,3 +36,3 @@ });

this.headers = {};
const headers = options.headers || {};
const headers = options.headers ?? {};
const fields = Object.keys(headers);

@@ -44,3 +44,3 @@ fields.forEach((field) => {

this.headers['user-agent'] = this.headers['user-agent'] || 'shot';
this.headers['user-agent'] = this.headers['user-agent'] ?? 'shot';

@@ -60,9 +60,10 @@ const hostHeaderFromUri = function () {

this.headers.host = this.headers.host || hostHeaderFromUri() || options.authority || 'localhost:80';
this.headers.host = this.headers.host ?? hostHeaderFromUri() ?? options.authority ?? 'localhost:80';
this.connection = {
remoteAddress: options.remoteAddress || '127.0.0.1'
// NOTE connection is deprecated in favor of socket as of node v13
this.socket = this.connection = {
remoteAddress: options.remoteAddress ?? '127.0.0.1'
};
let payload = options.payload || null;
let payload = options.payload ?? null;
if (payload &&

@@ -91,3 +92,3 @@ typeof payload !== 'string' &&

isDone: false,
simulate: options.simulate || {}
simulate: options.simulate ?? {}
};

@@ -94,0 +95,0 @@

{
"name": "@hapi/shot",
"description": "Injects a fake HTTP request/response into a node HTTP server",
"version": "5.0.5",
"version": "6.0.0-beta.0",
"repository": "git://github.com/hapijs/shot",

@@ -16,2 +16,7 @@ "main": "lib/index.js",

],
"eslintConfig": {
"extends": [
"plugin:@hapi/module"
]
},
"dependencies": {

@@ -22,4 +27,5 @@ "@hapi/hoek": "9.x.x",

"devDependencies": {
"@hapi/code": "8.x.x",
"@hapi/lab": "24.x.x"
"@hapi/code": "9.0.0-beta.0",
"@hapi/eslint-plugin": "*",
"@hapi/lab": "25.0.0-beta.0"
},

@@ -26,0 +32,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc