| var EventEmitter = require('events').EventEmitter, | ||
| http = require('http'), | ||
| propagate = require('propagate'), | ||
| OutgoingMessage = http.OutgoingMessage, | ||
@@ -152,4 +153,5 @@ ClientRequest = http.ClientRequest; | ||
| if (interceptor.options.allowUnmocked) { | ||
| ClientRequest.call(req, options, cb); | ||
| oldEnd.call(req, requestBody); | ||
| var newReq = new ClientRequest(options, cb); | ||
| propagate(newReq, req); | ||
| newReq.end(requestBody); | ||
| return; | ||
@@ -156,0 +158,0 @@ } |
+4
-1
| { "name" : "nock" | ||
| , "description" : "HTTP Server mocking for Node.js" | ||
| , "tags" : ["Mock", "HTTP", "testing", "isolation"] | ||
| , "version" : "0.15.1" | ||
| , "version" : "0.15.2" | ||
| , "author" : "Pedro Teixeira <pedro.teixeira@gmail.com>" | ||
@@ -33,2 +33,5 @@ , "contributors" : | ||
| , "main" : "./index" | ||
| , "dependencies": { | ||
| "propagate": "0.2.x" | ||
| } | ||
| , "devDependencies": { | ||
@@ -35,0 +38,0 @@ "tap": "0.4.x", |
@@ -1684,2 +1684,19 @@ var nock = require('../.') | ||
| }).end(); | ||
| }); | ||
| tap.test('allow unmocked post with json data', function(t) { | ||
| var scope = nock('https://httpbin.org', { allowUnmocked: true }). | ||
| get("/abc"). | ||
| reply(200, "Hey!"); | ||
| var options = { | ||
| method: 'POST', | ||
| uri: 'https://httpbin.org/post', | ||
| json: { some: 'data' } | ||
| }; | ||
| mikealRequest(options, function(err, resp, body) { | ||
| t.equal(200, resp.statusCode) | ||
| t.end(); | ||
| }); | ||
| }); |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
73761
0.71%2155
0.75%1
Infinity%+ Added
+ Added