webhook-tunnel
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "webhook-tunnel", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A little HTTP proxy suitable to create tunnels for webhook endpoints protected behind a firewall or a VPN", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -5,2 +5,3 @@ const { parse } = require('url') | ||
const isInCidr = (remoteAddress) => (cidr) => { | ||
console.log(cidr, remoteAddress) | ||
const range = new Netmask(cidr) | ||
@@ -23,4 +24,4 @@ return range.contains(remoteAddress) | ||
if (options.expectCidr) { | ||
if (!options.expectCidr.some(isInCidr(req.remoteAddress))) { | ||
throw new Error(`Request rejected, remote address "${req.remoteAddress}" not in expected CIDRs list`) | ||
if (!options.expectCidr.some(isInCidr(req.connection.remoteAddress))) { | ||
throw new Error(`Request rejected, remote address "${req.connection.remoteAddress}" not in expected CIDRs list`) | ||
} | ||
@@ -27,0 +28,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12412
144