Socket
Socket
Sign inDemoInstall

nock

Package Overview
Dependencies
Maintainers
1
Versions
430
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nock - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

15

lib/intercept.js

@@ -132,6 +132,15 @@ var path = require('path')

requestBody = requestBodyBuffers.map(function(buffer) {
return buffer.toString(encoding);
}).join('');
var requestBodySize = 0;
var copyTo = 0;
requestBodyBuffers.forEach(function(b) {
requestBodySize += b.length;
});
requestBody = new Buffer(requestBodySize);
requestBodyBuffers.forEach(function(b) {
b.copy(requestBody, copyTo);
copyTo += b.length;
});
requestBody = requestBody.toString();
interceptors = interceptors.filter(function(interceptor) {

@@ -138,0 +147,0 @@ return interceptor.match(options, requestBody);

2

lib/scope.js

@@ -35,3 +35,3 @@ var path = require('path')

var key = method.toUpperCase() + ' ' + basePath + uri;
if (typeof(requestBody) !== 'string') {
if (typeof(requestBody) != 'undefined' && typeof(requestBody) !== 'string') {
try {

@@ -38,0 +38,0 @@ requestBody = JSON.stringify(requestBody);

{ "name" : "nock"
, "description" : "HTTP Server mocking for Node.js"
, "tags" : ["Mock", "HTTP", "testing", "isolation"]
, "version" : "0.7.0"
, "version" : "0.7.1"
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com>"

@@ -6,0 +6,0 @@ , "contributors" :

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