Socket
Socket
Sign inDemoInstall

@hapi/shot

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/shot - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

21

lib/response.js

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

this._shot = { headers: null, trailers: {}, payloadChunks: [] };
this._headers = {}; // This forces node@8 to always render the headers
this.assignSocket(internals.nullSocket());

@@ -32,2 +31,22 @@

// Find the headers object if one was provided. If a headers object is present, call setHeader()
// on the first valid header, and then break out of the loop and call writeHead(). By calling
// setHeader(), Node will materialize a headers object.
const headers = args[args.length - 1];
if (typeof headers === 'object' && headers !== null) {
const headerNames = Object.keys(headers);
for (let i = 0; i < headerNames.length; ++i) {
const name = headerNames[i];
try {
this.setHeader(name, headers[name]);
break;
}
catch (ignoreErr) {} // Let the real writeHead() handle errors.
}
}
const result = super.writeHead(...args);

@@ -34,0 +53,0 @@

8

package.json
{
"name": "@hapi/shot",
"description": "Injects a fake HTTP request/response into a node HTTP server",
"version": "4.1.0",
"version": "4.1.1",
"repository": "git://github.com/hapijs/shot",

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

"dependencies": {
"@hapi/hoek": "6.x.x",
"@hapi/hoek": "8.x.x",
"@hapi/joi": "15.x.x"
},
"devDependencies": {
"@hapi/code": "5.x.x",
"@hapi/lab": "18.x.x"
"@hapi/code": "6.x.x",
"@hapi/lab": "20.x.x"
},

@@ -22,0 +22,0 @@ "scripts": {

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

<a href="http://hapijs.com"><img src="https://raw.githubusercontent.com/hapijs/assets/master/images/family.png" width="180px" align="right" /></a>
# shot

@@ -8,4 +10,2 @@

Lead Maintainer: [Matt Harrison](https://github.com/mtharrison)
## Example

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